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
[Due for payment 2026-10-23] Onboarding - Add work email button loads infinitely after returning from magic code & readding #104062
Version Number: 9.5.9-4 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#103652 Email or phone of affected tester (no customers):[email protected] Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Other
Action Performed:
Go to staging.new.expensify.com
Log in with new Gmail account.
Click Skip on work email step.
Click Join my company workspace.
Enter any email with private domain (eg, @gd.lowdn.com).
👋 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.
changed the title [-]Onboarding- Add work email button loads infinitely after returning from magic code & readding[/-][+]Onboarding - Add work email button loads infinitely after returning from magic code & readding[/+]on Oct 15, 2026
A one-line fix in BaseOnboardingWorkEmail.tsx resolves this. Reverting would pull an 80+ file feature that was already reverted and re-landed once, and follow-up PRs build on it. If a fix can't land quickly, revert #103652.
Root cause: On the second "Add work email" click, the email already equals session.email. So the same-email branch only sets shouldValidate: false and relies on the effect to navigate. The Join-Workspace effect branch that #103652 added returns early when hasSubmittedWorkEmail is false. That flag is local state, and it resets because the screen remounts after Back. Nothing navigates and no request is sent, so the button spinner never stops.
With both values set, the existing Join-Workspace branch goes to the magic code step (L179). Non-join flows never read hasSubmittedWorkEmail, so this fix doesn't change them.
📋 Detailed analysis
Sequence
First submit (step 6):submitWorkEmail sets hasSubmittedWorkEmail = true and calls AddWorkEmail (L250-L253). A new private domain becomes the unvalidated primary login (session.email) with shouldValidate: false. The screen is replaced by the magic code step.
Back (step 7):BaseOnboardingPrivateDomain calls updateOnboardingValuesAndNavigation. It resets shouldValidate and returns to a freshly mounted work email screen, so hasSubmittedWorkEmail is false.
Second submit (step 8): The draft email equals sessionEmail, so the code takes the same-email branch and returns early. The Join-Workspace effect gate blocks navigation. The older non-join path (L191-L205) has no such gate, which is why only this intent breaks.
Spinner:FormProvider defaults shouldShowLoadingImmediatelyOnPress to true. usePressLoading keeps the spinner on until the form's isLoading turns true or the screen regains focus. Neither happens on this path.
The bug reproduces only for a new domain. If the domain already has an account, shouldValidate is true and session.email doesn't change. The second click then calls AddWorkEmail normally.
Add a case to tests/ui/WorkEmailOnboardingNavigation.tsx:
Given the join intent and a session.email equal to the draft email, on a fresh mount,
When the user submits,
Then the user lands on the magic code step.
Suggested AI code review rule
This class of bug has been fixed before (#96087, #99344, #100044, #102198). A rule for app-coding-standards could catch it:
Rule: Every FormProvider submit path must start loading or leave the screen.
Condition: Flag an onSubmit passed to <FormProvider> without shouldShowLoadingImmediatelyOnPress={false} when it has a return path that neither calls an action that sets the form's isLoading nor navigates away.
Why:usePressLoading keeps the spinner until isLoading turns true or the screen regains focus, so that path spins forever.
changed the title [-]Onboarding - Add work email button loads infinitely after returning from magic code & readding[/-][+][Due for payment 2026-10-23] Onboarding - Add work email button loads infinitely after returning from magic code & readding[/+]on Oct 16, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.12-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-10-23. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
applause-bot commentedon Oct 15, 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/73e19901419f88eae94e56a7faee1f31da19bb24f7363fbedd22642b6da83747
melvin-bot commentedon Oct 15, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #103652
melvin-bot commentedon Oct 15, 2026
@iwiznia @abzokhattab you have been assigned to this deploy blocker because you reviewed the offending PR: #103652
melvin-bot commentedon Oct 15, 2026
@carlosmiceli you have been assigned to this deploy blocker because you authored the offending PR: #103652
melvin-bot commentedon Oct 15, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Oct 15, 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:
[-]Onboarding- Add work email button loads infinitely after returning from magic code & readding[/-][+]Onboarding - Add work email button loads infinitely after returning from magic code & readding[/+]MelvinBot commentedon Oct 15, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: [Payment due @abzokhattab] Add the join-workspace onboarding intent and Concierge follow up tasks by
carlosmiceli(High confidence)Recommendation: Roll forward
A one-line fix in
BaseOnboardingWorkEmail.tsxresolves this. Reverting would pull an 80+ file feature that was already reverted and re-landed once, and follow-up PRs build on it. If a fix can't land quickly, revert #103652.Root cause: On the second "Add work email" click, the email already equals
session.email. So the same-email branch only setsshouldValidate: falseand relies on the effect to navigate. The Join-Workspace effect branch that #103652 added returns early whenhasSubmittedWorkEmailis false. That flag is local state, and it resets because the screen remounts after Back. Nothing navigates and no request is sent, so the button spinner never stops.Suggested fix:
With both values set, the existing Join-Workspace branch goes to the magic code step (L179). Non-join flows never read
hasSubmittedWorkEmail, so this fix doesn't change them.📋 Detailed analysis
Sequence
submitWorkEmailsetshasSubmittedWorkEmail = trueand callsAddWorkEmail(L250-L253). A new private domain becomes the unvalidated primary login (session.email) withshouldValidate: false. The screen is replaced by the magic code step.BaseOnboardingPrivateDomaincallsupdateOnboardingValuesAndNavigation. It resetsshouldValidateand returns to a freshly mounted work email screen, sohasSubmittedWorkEmailisfalse.sessionEmail, so the code takes the same-email branch and returns early. The Join-Workspace effect gate blocks navigation. The older non-join path (L191-L205) has no such gate, which is why only this intent breaks.FormProviderdefaultsshouldShowLoadingImmediatelyOnPressto true.usePressLoadingkeeps the spinner on until the form'sisLoadingturns true or the screen regains focus. Neither happens on this path.The bug reproduces only for a new domain. If the domain already has an account,
shouldValidateis true andsession.emaildoesn't change. The second click then callsAddWorkEmailnormally.Other staging PRs ruled out
#103532, #103537, #104016, #103837, #103414, #103832, and #103718 don't touch this submit or navigation path.
Regression test
Add a case to
tests/ui/WorkEmailOnboardingNavigation.tsx:session.emailequal to the draft email, on a fresh mount,Suggested AI code review rule
This class of bug has been fixed before (#96087, #99344, #100044, #102198). A rule for
app-coding-standardscould catch it:FormProvidersubmit path must start loading or leave the screen.onSubmitpassed to<FormProvider>withoutshouldShowLoadingImmediatelyOnPress={false}when it has areturnpath that neither calls an action that sets the form'sisLoadingnor navigates away.usePressLoadingkeeps the spinner untilisLoadingturns true or the screen regains focus, so that path spins forever.Next Steps: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.view run
hungvu193 commentedon Oct 15, 2026
on it
[-]Onboarding - Add work email button loads infinitely after returning from magic code & readding[/-][+][Due for payment 2026-10-23] Onboarding - Add work email button loads infinitely after returning from magic code & readding[/+]melvin-bot commentedon Oct 16, 2026
@abzokhattab
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.12-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-10-23. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]