Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't consider user lifecycle status when repeating evaluation #39069

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export type WelcomeFlowExperiment = {
const WelcomeFlow: FC< PropsWithChildren > = ( { children } ) => {
const { recordEvent } = useAnalytics();
const { dismissWelcomeBanner } = useWelcomeBanner();
const { submitEvaluation, saveEvaluationResult } = useEvaluationRecommendations();
const { recommendedModules, submitEvaluation, saveEvaluationResult } =
useEvaluationRecommendations();
const {
siteIsRegistered,
siteIsRegistering,
Expand All @@ -44,15 +45,27 @@ const WelcomeFlow: FC< PropsWithChildren > = ( { children } ) => {
if ( ! siteIsRegistered || welcomeFlowExperiment.isLoading ) {
return 'connection';
} else if ( ! isProcessingEvaluation ) {
if ( ! isJetpackUserNew() || welcomeFlowExperiment.variation !== 'treatment' ) {
// If the user is not new, we don't show the evaluation step
if (
! recommendedModules &&
( welcomeFlowExperiment.variation === 'control' || ! isJetpackUserNew() )
) {
// If user is not new but doesn't have recommendations, we skip evaluation
// If user has recommendations, it means they were already in treatment group and they redo the evaluation
return null;
}

// Otherwise, it means user is either new or just repeats the recommendation
return 'evaluation';
}

return 'evaluation-processing';
}, [ isProcessingEvaluation, siteIsRegistered, welcomeFlowExperiment ] );
}, [
isProcessingEvaluation,
recommendedModules,
siteIsRegistered,
welcomeFlowExperiment.isLoading,
welcomeFlowExperiment.variation,
] );

useEffect( () => {
if ( prevStep !== currentStep ) {
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/my-jetpack/changelog/fix-welcome-flow-redo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Don't consider user lifecycle status when repeating evaluation
Loading