Skip to content

[Due for payment 2026-10-23] Magic code step is skipped after clicking Add work email when work email is existing account #104063

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


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:

  1. Go to staging.new.expensify.com
  2. Log in with new Gmail account.
  3. Click Skip on work email step.
  4. Click Join my company workspace.
  5. Enter an existing account from private domain (eg, [email protected]).
  6. Click Add work email.
  7. Click Skip on magic code step.
  8. Click back button.
  9. Click Join my company workspace.
  10. Click Add work email.

Expected Result:

Next step will be magic code step after clicking Add work email.

Actual Result:

Magic code step is skipped after clicking Add work email when work email is existing account.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7286941_1792047222341.13.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7286941

Issue OwnerCurrent Issue Owner: @abzokhattab

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 15, 2026
  2. applause-bot commented on Oct 15, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/e4a55c70c2c792b381dba327a22088308f505e11a59479430f830577fd51338b

  3. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #103652

  4. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    @iwiznia @abzokhattab you have been assigned to this deploy blocker because you reviewed the offending PR: #103652

  5. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    @carlosmiceli you have been assigned to this deploy blocker because you authored the offending PR: #103652

  6. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  7. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  8. MelvinBot commented on Oct 15, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Analysis

    Causing PR: [Payment due @abzokhattab] Add the join-workspace onboarding intent and Concierge follow up tasks. Confidence: medium-high.

    Recommendation: Fix forward. Don't revert. It is a frontend bug, so DeployBlockerCash should stay. Production is not affected because the feature only exists on staging.

    Root cause: Pressing Skip on the magic code screen stores isMergeAccountStepCompleted: true and isMergeAccountStepSkipped: true. Nothing clears those flags when you go back and add the work email again. When the magic code screen opens the second time, its navigation effect sees the old flags. It then sends you straight to Personal Details.

    Recommended fix: In submitWorkEmail (BaseOnboardingWorkEmail.tsx#L250), clear isMergeAccountStepCompleted and isMergeAccountStepSkipped along with shouldValidate. The Join-workspace branch of that screen (L171-L180) doesn't read either flag, so this is safe. Add a UI test that covers skip, back, and add the same email again.

    Investigation details

    All links point to the 9.5.9-4 commit 978256f.

    1. Step 7 (Skip): Skip calls setOnboardingMergeAccountStepValue(true, true) (BaseOnboardingWorkEmailValidation.tsx#L292-L299). That writes both flags (Welcome/index.ts#L119-L121).
    2. Steps 8-10 (Back and re-add): Join my company workspace clears only isMergingAccountBlocked (BaseOnboardingPurpose.tsx#L137-L148). Submitting the email calls clearOnboardingShouldValidate, which clears only shouldValidate (Welcome/index.ts#L111-L113, called at BaseOnboardingWorkEmail.tsx#L250-L253).
    3. Magic code screen opens: AddWorkEmail returns shouldValidate: true, so the app opens the magic code screen (BaseOnboardingWorkEmail.tsx#L171-L180, added by the causing PR).
    4. Magic code screen leaves at once: Its effect sees the old completed and skipped flags. With the Join-workspace intent, it navigates to Personal Details (BaseOnboardingWorkEmailValidation.tsx#L97-L132). The causing PR added that Join-workspace branch at L125-L128. Before that PR, you couldn't get back to the work email screen after skipping, so the flags were never stale.

    Why not revert: The PR is an 80-file feature that has already been reverted and re-landed once. Another PR in this release also builds on it. The bug needs a narrow sequence of steps. Skipping the code never merges accounts, so there is no security or data-loss risk. If a fix can't land before the deploy, demoting the blocker is reasonable.

    Other onboarding PRs in this release: None of them touch the merge-step flags or the magic code screen's navigation, so I ruled them out.

    Alternative fix: Make the magic code screen react only when the flags change while it is open. To do that, store their values from when the screen opened in a ref.

    Open question: Skipping the first work email screen (step 3, BaseOnboardingWorkEmail.tsx#L433) sets the same flags. The first pass still showed the magic code step, so a server update probably reset the onboarding data between steps 3 and 6. I couldn't confirm that from App code. It doesn't change the conclusion: the flags written at step 7 are never cleared before step 10.


    view run

  9. self-assigned this
    on Oct 15, 2026
  10. hungvu193 commented on Oct 15, 2026

    @hungvu193
    Contributor

    on it

  11. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Oct 15, 2026
  12. changed the title [-]Magic code step is skipped after clicking Add work email when work email is existing account[/-] [+][Due for payment 2026-10-23] Magic code step is skipped after clicking Add work email when work email is existing account[/+] on Oct 16, 2026
  13. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    @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]

  14. added
    Skip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringSkip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions