You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$250] Emails-Two "Your free trial has started" emails sent to the user after onboarding #91783
Version Number: 9.3.83-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176726/test-cases/41237090 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: MacBook Air 26.5 Chrome, iPhone 15 iOS 26.5 App Component: Notifications
Action Performed:
Navigate to staging.new.expensify.com
Enter a new email address with a "+"that you can access
On the onboarding select "Manage my team's expenses" - 5-10 - QBO
Complete the onboarding
Open the Inbox for the onboarded user, look for the email with the subject "Your free trial has started! Let's get you set up."
Expected Result:
Only one "Free trial" email arrives
Actual Result:
Onboarded user receives two identical "Your free trial has started! Let's get you set up." emails
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Problem: During the "Manage my team's expenses" onboarding flow, the App sends two separate API calls to the backend — CreateWorkspace then CompleteGuidedSetup — and both carry engagementChoice='newDotManageTeam'. The backend appears to trigger the "free trial started" email on both commands, resulting in two identical emails.
Solution: The backend should deduplicate the free trial email. However, from the App side, the fix is to stop sending engagementChoice on CreateWorkspace when it will also be sent on the subsequent CompleteGuidedSetup call (i.e., when shouldAddOnboardingTasks is false). This way, only CompleteGuidedSetup triggers the trial email.
In buildPolicyData in Policy.ts, engagementChoice is unconditionally included in CreateWorkspace params (line ~3021), but guidedSetupData is only included when shouldAddOnboardingTasks is true (line ~3031). When shouldAddOnboardingTasks is false (the MANAGE_TEAM flow from BaseOnboardingInterestedFeatures.tsx:207), CreateWorkspace sends engagementChoice without guidedSetupData, and then CompleteGuidedSetup sends engagementChoice again with the full guided setup data — giving the backend two separate signals to start the trial.
What needs to change:
In Policy.ts around line 3021: Only include engagementChoice (and companySize, userReportedIntegration) in CreateWorkspace params when shouldAddOnboardingTasks is true — i.e., when CreateWorkspace is bundling the guided setup data and no separate CompleteGuidedSetup call will follow. When shouldAddOnboardingTasks is false, these fields should be omitted from CreateWorkspace since they'll be sent on the subsequent CompleteGuidedSetup call.
Investigation details
Why staging-only: PR Expensify/App#89469 (merged May 21) dropped the cohort gate so that all MANAGE_TEAM signups now use the bespoke server-side welcome path. The key commit 41c1461264c ("Remove client-side bespoke welcome message generation") made the server the sole source of truth for admins room welcome content. This likely changed how the backend processes CreateWorkspace with engagementChoice — previously the backend may not have acted on engagementChoice in CreateWorkspace for trial email purposes, but with the server now owning welcome message generation, it processes the engagement choice on both commands.
Data flow:
User selects "Manage my team's expenses" → 5-10 → QBO → Continue
BaseOnboardingInterestedFeatures.tsx:199: createWorkspace() sends CreateWorkspace API with engagementChoice='newDotManageTeam', companySize, shouldAddOnboardingTasks: false
Backend receives both → triggers trial email twice
Alternative considered: Double-tap on the Continue button could also cause CompleteGuidedSetup to fire twice, but the isLoading guard at line 186 and the pattern of exactly two emails (not random multiples) more strongly supports the two-different-API-calls theory.
Note: The backend (Auth/Web-Expensify) should also add deduplication for the trial email as a defense-in-depth measure, but those repos were inaccessible for this investigation.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Based on my earlier analysis, the likely introducing PR is #89469 ("Onboarding: drop cohort gate now that server generates per-tier welcome"), merged May 21.
That PR removed the cohort gate so all MANAGE_TEAM signups use the server-side welcome path. This changed how the backend processes the engagementChoice param — it now acts on it in both the CreateWorkspace and CompleteGuidedSetup API calls, triggering the trial email twice. Previously, the backend likely only triggered the email on CompleteGuidedSetup.
Activity
applause-bot commentedon May 27, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/4c2be4870cff65042b4dfe1599684397196cae398892cf403d4a37e648008d83
melvin-bot commentedon May 27, 2026
Triggered auto assignment to @mjasikowski (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon May 27, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 27, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
mitarachim commentedon May 27, 2026
Issue not reproducible when Use Staging Server is
OFF/Disabless.off.email.mp4
MelvinBot commentedon May 27, 2026
Proposal
Problem: During the "Manage my team's expenses" onboarding flow, the App sends two separate API calls to the backend —
CreateWorkspacethenCompleteGuidedSetup— and both carryengagementChoice='newDotManageTeam'. The backend appears to trigger the "free trial started" email on both commands, resulting in two identical emails.Solution: The backend should deduplicate the free trial email. However, from the App side, the fix is to stop sending
engagementChoiceonCreateWorkspacewhen it will also be sent on the subsequentCompleteGuidedSetupcall (i.e., whenshouldAddOnboardingTasksisfalse). This way, onlyCompleteGuidedSetuptriggers the trial email.In
buildPolicyDatain Policy.ts,engagementChoiceis unconditionally included inCreateWorkspaceparams (line ~3021), butguidedSetupDatais only included whenshouldAddOnboardingTasksis true (line ~3031). WhenshouldAddOnboardingTasksis false (the MANAGE_TEAM flow fromBaseOnboardingInterestedFeatures.tsx:207),CreateWorkspacesendsengagementChoicewithoutguidedSetupData, and thenCompleteGuidedSetupsendsengagementChoiceagain with the full guided setup data — giving the backend two separate signals to start the trial.What needs to change:
Policy.tsaround line 3021: Only includeengagementChoice(andcompanySize,userReportedIntegration) inCreateWorkspaceparams whenshouldAddOnboardingTasksis true — i.e., whenCreateWorkspaceis bundling the guided setup data and no separateCompleteGuidedSetupcall will follow. WhenshouldAddOnboardingTasksis false, these fields should be omitted fromCreateWorkspacesince they'll be sent on the subsequentCompleteGuidedSetupcall.Investigation details
Why staging-only: PR Expensify/App#89469 (merged May 21) dropped the cohort gate so that all MANAGE_TEAM signups now use the bespoke server-side welcome path. The key commit
41c1461264c("Remove client-side bespoke welcome message generation") made the server the sole source of truth for admins room welcome content. This likely changed how the backend processesCreateWorkspacewithengagementChoice— previously the backend may not have acted onengagementChoiceinCreateWorkspacefor trial email purposes, but with the server now owning welcome message generation, it processes the engagement choice on both commands.Data flow:
BaseOnboardingInterestedFeatures.tsx:199:createWorkspace()sendsCreateWorkspaceAPI withengagementChoice='newDotManageTeam',companySize,shouldAddOnboardingTasks: falseBaseOnboardingInterestedFeatures.tsx:227:completeOnboarding()sendsCompleteGuidedSetupAPI with sameengagementChoice,companySize, plusguidedSetupDataAlternative considered: Double-tap on the Continue button could also cause
CompleteGuidedSetupto fire twice, but theisLoadingguard at line 186 and the pattern of exactly two emails (not random multiples) more strongly supports the two-different-API-calls theory.Note: The backend (Auth/Web-Expensify) should also add deduplication for the trial email as a defense-in-depth measure, but those repos were inaccessible for this investigation.
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.mjasikowski commentedon May 27, 2026
@MelvinBot which PR introduced the duplication?
MelvinBot commentedon May 27, 2026
Based on my earlier analysis, the likely introducing PR is #89469 ("Onboarding: drop cohort gate now that server generates per-tier welcome"), merged May 21.
That PR removed the cohort gate so all MANAGE_TEAM signups use the server-side welcome path. This changed how the backend processes the
engagementChoiceparam — it now acts on it in both theCreateWorkspaceandCompleteGuidedSetupAPI calls, triggering the trial email twice. Previously, the backend likely only triggered the email onCompleteGuidedSetup.mjasikowski commentedon May 27, 2026
@MelvinBot #89469 is already in production and the bug doesn't seem to be reproducible in production, only on staging
57 remaining items
mjasikowski commentedon Jun 8, 2026
Still working on the BE fix
mjasikowski commentedon Jun 11, 2026
BE fix in review
mjasikowski commentedon Jun 15, 2026
Still waiting for review
mjasikowski commentedon Jun 18, 2026
This is merged now and should be no longer happening