Skip to content

Commit 3051ace

Browse files
committed
remove hash detection from URL as now redundant given parameter checks for middleware
1 parent 16bde04 commit 3051ace

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

dotcom-rendering/src/client/abTesting.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { getCookie, isUndefined } from '@guardian/libs';
2-
import { getForcedParticipationsFromUrlFlat } from '../lib/getAbUrlHash';
32

43
const AB_COOKIE_NAME = 'gu_client_ab_tests';
54

@@ -38,7 +37,6 @@ const getABTestParticipations = (): ABParticipations => {
3837
return {
3938
...getClientParticipations(),
4039
...window.guardian.config.serverSideABTests,
41-
...getForcedParticipationsFromUrlFlat(window.location.hash),
4240
};
4341
};
4442

dotcom-rendering/src/lib/getAbUrlHash.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,3 @@ export const getForcedParticipationsFromUrl = (
2121

2222
return {};
2323
};
24-
25-
export const getForcedParticipationsFromUrlFlat = (
26-
windowHash: string,
27-
): Record<string, string> => {
28-
if (windowHash.startsWith('#ab')) {
29-
const tokens = windowHash
30-
.replace('#ab-', '')
31-
.split(',')
32-
.map((token) => token.replace(/^ab-/, ''));
33-
return tokens.reduce<Record<string, string>>((obj, token) => {
34-
const [testId, variantId] = token.split('=');
35-
36-
if (testId && variantId) {
37-
return {
38-
...obj,
39-
[testId]: variantId,
40-
};
41-
}
42-
43-
return obj;
44-
}, {});
45-
}
46-
47-
return {};
48-
};

0 commit comments

Comments
 (0)