From c1c2d7e3a892f948d0dcc7fa27633522af06352d Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Mon, 6 Jan 2025 10:47:11 +1300 Subject: [PATCH 1/4] /start/onboarding always redirects to /setup/onboarding --- client/signup/controller.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/signup/controller.js b/client/signup/controller.js index 579f505862d8b4..0c9febf93769dd 100644 --- a/client/signup/controller.js +++ b/client/signup/controller.js @@ -254,10 +254,6 @@ export default { await loadExperimentAssignment( 'calypso_signup_onboarding_aa_test' ); setHasRedirectedForExperiment(); - const stepperOnboardingExperimentAssignment = await loadExperimentAssignment( - 'calypso_signup_onboarding_stepper_flow_confidence_check_3' - ); - setReferrerPolicy(); let url = getStepUrl( @@ -266,7 +262,7 @@ export default { getStepSectionName( context.params ), localeFromParams ?? localeFromStore, null, - stepperOnboardingExperimentAssignment.variationName === 'stepper' ? '/setup' : '/start' + '/setup' ) + '?redirected_1220=true' + ( context.querystring ? '&' + context.querystring : '' ) + From d8fc88a1575a6c427cd914711710bd271dc0db9f Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Mon, 6 Jan 2025 10:47:49 +1300 Subject: [PATCH 2/4] Remove unused calypso_signup_onboarding_aa_test assignment --- client/signup/controller.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/signup/controller.js b/client/signup/controller.js index 0c9febf93769dd..bbf2d0e7449f75 100644 --- a/client/signup/controller.js +++ b/client/signup/controller.js @@ -5,7 +5,6 @@ import { createElement } from 'react'; import store from 'store'; import { notFound } from 'calypso/controller'; import { recordPageView } from 'calypso/lib/analytics/page-view'; -import { loadExperimentAssignment } from 'calypso/lib/explat'; import { isWooOAuth2Client } from 'calypso/lib/oauth2-clients'; import { login } from 'calypso/lib/paths'; import { sectionify } from 'calypso/lib/route'; @@ -251,7 +250,6 @@ export default { const isOnboardingFlow = flowName === 'onboarding'; if ( isOnboardingFlow && ! hasRedirected ) { - await loadExperimentAssignment( 'calypso_signup_onboarding_aa_test' ); setHasRedirectedForExperiment(); setReferrerPolicy(); From b102d27adb9e169ac4ff6fc12e48300f84f87cb4 Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Mon, 6 Jan 2025 10:49:14 +1300 Subject: [PATCH 3/4] Remove double-redirect checks now that /start isn't redirecting back to /start --- client/signup/controller.js | 14 +------------- client/signup/storageUtils.js | 15 --------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/client/signup/controller.js b/client/signup/controller.js index bbf2d0e7449f75..2db944db55fddd 100644 --- a/client/signup/controller.js +++ b/client/signup/controller.js @@ -31,8 +31,6 @@ import { clearSignupDestinationCookie, getSignupCompleteFlowName, wasSignupCheckoutPageUnloaded, - setHasRedirectedForExperiment, - getHasRedirectedForExperiment, } from './storageUtils'; import { getStepUrl, @@ -240,18 +238,9 @@ export default { store.set( 'signup-locale', localeFromParams ); - const hasRedirected = - context.querystring?.includes( 'redirected_1220=true' ) || - // Check the URL as well because sometimes the context.querystring lags behind the URL. - new URLSearchParams( window.location.search ).has( 'redirected_1220' ) || - // Check session storage in case the query parma was omitted. - getHasRedirectedForExperiment(); - const isOnboardingFlow = flowName === 'onboarding'; - if ( isOnboardingFlow && ! hasRedirected ) { - setHasRedirectedForExperiment(); - + if ( isOnboardingFlow ) { setReferrerPolicy(); let url = getStepUrl( @@ -262,7 +251,6 @@ export default { null, '/setup' ) + - '?redirected_1220=true' + ( context.querystring ? '&' + context.querystring : '' ) + ( context.hashstring ? '#' + context.hashstring : '' ); diff --git a/client/signup/storageUtils.js b/client/signup/storageUtils.js index 81544f99460d9a..b914ae9509afde 100644 --- a/client/signup/storageUtils.js +++ b/client/signup/storageUtils.js @@ -61,21 +61,6 @@ export const setSignupCheckoutPageUnloaded = ( value ) => export const getSignupCompleteFlowName = () => ignoreFatalsForStorage( () => sessionStorage?.getItem( 'wpcom_signup_complete_flow_name' ) ); -export const getHasRedirectedForExperiment = () => - ignoreFatalsForStorage( () => - sessionStorage?.getItem( - 'wpcom_redirected_calypso_signup_onboarding_stepper_flow_confidence_check_2' - ) - ); - -export const setHasRedirectedForExperiment = () => - ignoreFatalsForStorage( () => - sessionStorage?.setItem( - 'wpcom_redirected_calypso_signup_onboarding_stepper_flow_confidence_check_2', - '1' - ) - ); - export const setSignupCompleteFlowName = ( value ) => ignoreFatalsForStorage( () => sessionStorage?.setItem( 'wpcom_signup_complete_flow_name', value ) From 28ba7a768e9ca1a3d4f282e0aa703a9ddca24ff3 Mon Sep 17 00:00:00 2001 From: Candy Tsai Date: Mon, 6 Jan 2025 17:52:25 +0800 Subject: [PATCH 4/4] fix query params on redirect --- client/signup/controller.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/signup/controller.js b/client/signup/controller.js index 2db944db55fddd..8241e3c902c2b1 100644 --- a/client/signup/controller.js +++ b/client/signup/controller.js @@ -1,5 +1,6 @@ import config from '@automattic/calypso-config'; import page from '@automattic/calypso-router'; +import { isOnboardingFlow } from '@automattic/onboarding'; import { isEmpty } from 'lodash'; import { createElement } from 'react'; import store from 'store'; @@ -238,9 +239,7 @@ export default { store.set( 'signup-locale', localeFromParams ); - const isOnboardingFlow = flowName === 'onboarding'; - - if ( isOnboardingFlow ) { + if ( isOnboardingFlow( flowName ) ) { setReferrerPolicy(); let url = getStepUrl( @@ -251,7 +250,7 @@ export default { null, '/setup' ) + - ( context.querystring ? '&' + context.querystring : '' ) + + ( context.querystring ? '?' + context.querystring : '' ) + ( context.hashstring ? '#' + context.hashstring : '' ); if ( document.referrer ) {