Skip to content

Commit d2dd614

Browse files
authored
Remove A/B testing code for registration flow (#3386)
1 parent 8d4d92b commit d2dd614

File tree

4 files changed

+8
-127
lines changed

4 files changed

+8
-127
lines changed

src/frontend/src/lib/components/wizards/auth/AuthWizard.svelte

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import Dialog from "$lib/components/ui/Dialog.svelte";
88
import SetupOrUseExistingPasskey from "$lib/components/wizards/auth/views/SetupOrUseExistingPasskey.svelte";
99
import CreatePasskey from "$lib/components/wizards/auth/views/CreatePasskey.svelte";
10-
import InfoPasskey from "$lib/components/wizards/auth/views/InfoPasskey.svelte";
1110
import SystemOverlayBackdrop from "$lib/components/utils/SystemOverlayBackdrop.svelte";
1211
import { RegisterAccessMethodWizard } from "$lib/components/wizards/registerAccessMethod";
1312
import { canisterConfig } from "$lib/globals";
@@ -67,23 +66,7 @@
6766
isAuthenticating = true;
6867
try {
6968
const result = await authFlow.submitNameAndContinue(name);
70-
if (result?.type === "created") {
71-
onSignUp(result.identityNumber);
72-
}
73-
} catch (error) {
74-
if (isWebAuthnCancelError(error)) {
75-
return "cancelled";
76-
}
77-
onError(error); // Propagate unhandled errors to parent component
78-
} finally {
79-
isAuthenticating = false;
80-
}
81-
};
82-
83-
const handleContinueCreatePasskey = async (): Promise<void | "cancelled"> => {
84-
isAuthenticating = true;
85-
try {
86-
onSignUp(await authFlow.createPasskey());
69+
onSignUp(result.identityNumber);
8770
} catch (error) {
8871
if (isWebAuthnCancelError(error)) {
8972
return "cancelled";
@@ -160,16 +143,10 @@
160143
{:else if authFlow.view === "setupNewPasskey"}
161144
<CreatePasskey
162145
create={handleCreatePasskey}
163-
buttonLabel={authFlow.abTestGroup === "infoPasskey"
164-
? "Continue"
165-
: $AUTH_FLOW_UPDATES
166-
? "Create Identity"
167-
: "Create Passkey"}
146+
buttonLabel={$AUTH_FLOW_UPDATES ? "Create Identity" : "Create Passkey"}
168147
/>
169148
{:else if authFlow.view === "setupNewIdentity"}
170149
<CreateIdentity create={handleCompleteOpenIdRegistration} />
171-
{:else if authFlow.view === "infoPasskey"}
172-
<InfoPasskey create={handleContinueCreatePasskey} />
173150
{/if}
174151
{/snippet}
175152

src/frontend/src/lib/components/wizards/auth/views/InfoPasskey.svelte

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/frontend/src/lib/flows/authFlow.svelte.ts

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class AuthFlow {
4444
| "chooseMethod"
4545
| "setupOrUseExistingPasskey"
4646
| "setupNewPasskey"
47-
| "infoPasskey"
4847
| "setupNewIdentity"
4948
>("chooseMethod");
5049
#captcha = $state<{
@@ -57,7 +56,6 @@ export class AuthFlow {
5756
#name = $state<string>();
5857
#jwt = $state<string>();
5958
#configIssuer = $state<string>();
60-
abTestGroup: "infoPasskey" | "default";
6159

6260
get view() {
6361
return this.#view;
@@ -77,32 +75,22 @@ export class AuthFlow {
7775

7876
constructor() {
7977
this.chooseMethod();
80-
const isE2E = nonNullish(canisterConfig.dummy_auth[0]?.[0]);
81-
// No A/B test in E2E runs
82-
const GROUP_INFO_PERCENTAGE = isE2E ? -1 : 0.2;
83-
this.abTestGroup =
84-
Math.random() < GROUP_INFO_PERCENTAGE ? "infoPasskey" : "default";
8578
}
8679

8780
chooseMethod = (): void => {
88-
authenticationV2Funnel.trigger(AuthenticationV2Events.SelectMethodScreen, {
89-
abTestGroup: this.abTestGroup,
90-
});
81+
authenticationV2Funnel.trigger(AuthenticationV2Events.SelectMethodScreen);
9182
this.#view = "chooseMethod";
9283
};
9384

9485
setupOrUseExistingPasskey = (): void => {
9586
authenticationV2Funnel.trigger(
9687
AuthenticationV2Events.ContinueWithPasskeyScreen,
97-
{ abTestGroup: this.abTestGroup },
9888
);
9989
this.#view = "setupOrUseExistingPasskey";
10090
};
10191

10292
continueWithExistingPasskey = async (): Promise<bigint> => {
103-
authenticationV2Funnel.trigger(AuthenticationV2Events.UseExistingPasskey, {
104-
abTestGroup: this.abTestGroup,
105-
});
93+
authenticationV2Funnel.trigger(AuthenticationV2Events.UseExistingPasskey);
10694
const { identity, identityNumber, credentialId } =
10795
await authenticateWithPasskey({
10896
canisterId,
@@ -120,31 +108,20 @@ export class AuthFlow {
120108
};
121109

122110
setupNewPasskey = (): void => {
123-
authenticationV2Funnel.trigger(AuthenticationV2Events.EnterNameScreen, {
124-
abTestGroup: this.abTestGroup,
125-
});
111+
authenticationV2Funnel.trigger(AuthenticationV2Events.EnterNameScreen);
126112
this.#view = "setupNewPasskey";
127113
};
128114

129115
submitNameAndContinue = async (
130116
name: string,
131-
): Promise<undefined | { type: "created"; identityNumber: bigint }> => {
117+
): Promise<{ type: "created"; identityNumber: bigint }> => {
132118
this.#name = name;
133-
if (this.abTestGroup === "infoPasskey") {
134-
authenticationV2Funnel.trigger(AuthenticationV2Events.InfoPasskeyScreen, {
135-
abTestGroup: this.abTestGroup,
136-
});
137-
this.#view = "infoPasskey";
138-
return;
139-
} else {
140-
return { type: "created", identityNumber: await this.createPasskey() };
141-
}
119+
return { type: "created", identityNumber: await this.createPasskey() };
142120
};
143121

144122
createPasskey = async (): Promise<bigint> => {
145123
authenticationV2Funnel.trigger(
146124
AuthenticationV2Events.StartWebauthnCreation,
147-
{ abTestGroup: this.abTestGroup },
148125
);
149126
if (isNullish(this.#name)) {
150127
throw new Error("Name is not set");
@@ -360,9 +337,7 @@ export class AuthFlow {
360337
passkeyIdentity: DiscoverablePasskeyIdentity,
361338
attempts = 0,
362339
): Promise<bigint> => {
363-
authenticationV2Funnel.trigger(AuthenticationV2Events.RegisterWithPasskey, {
364-
abTestGroup: this.abTestGroup,
365-
});
340+
authenticationV2Funnel.trigger(AuthenticationV2Events.RegisterWithPasskey);
366341
const uaParser = loadUAParser();
367342
const alias = await inferPasskeyAlias({
368343
authenticatorType: passkeyIdentity.getAuthenticatorAttachment(),
@@ -387,7 +362,6 @@ export class AuthFlow {
387362
.then(throwCanisterError);
388363
authenticationV2Funnel.trigger(
389364
AuthenticationV2Events.SuccessfulPasskeyRegistration,
390-
{ abTestGroup: this.abTestGroup },
391365
);
392366
const credentialId = new Uint8Array(passkeyIdentity.getCredentialId()!);
393367
const identity = await authenticateWithSession({

src/frontend/src/lib/utils/analytics/authenticationV2Funnel.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { Funnel } from "./Funnel";
2828
* jwt-verification-expired
2929
* continue-with-passkey-screen
3030
* enter-name-screen
31-
* [info-passkey-screen]
3231
* start-webauthn-creation
3332
* register-with-passkey
3433
* successful-passkey-registration
@@ -57,7 +56,6 @@ export const AuthenticationV2Events = {
5756
AuthSuccess: "auth-success",
5857
JwtVerificationFailed: "jwt-verification-failed",
5958
JwtVerificationExpired: "jwt-verification-expired",
60-
InfoPasskeyScreen: "info-passkey-screen",
6159
GoToDashboard: "go-to-dashboard",
6260
} as const;
6361

0 commit comments

Comments
 (0)