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-07-29] [$250] [Exploratory] Web - Login - Nothing happen after click on request one here link on MC expired page #90929
When a magic-link URL (/v/<accountID>/<validateCode>) is opened directly in a fresh tab, that /v/... route becomes the root of the navigation stack — there is nothing behind it.
beginSignIn() requests a new code in the background, but the UI transition depends entirely on Navigation.goBack(). From the root /v/... route there is no previous screen, so goBack() hits its no-op guard, logs [Navigation] Unable to go back, and returns without navigating (Navigation.ts:518-552). The expired-code modal stays mounted → "nothing happens."
This is why the bug only reproduces in a new tab: when the user was already on the sign-in page in the same session, TAB_NAVIGATOR (which hosts SignInPage) sits below /v/ in the stack, so goBack() succeeds and reveals the code-entry form.
Evidence / data flow
SignInPage (the magic-code entry form) and ValidateLoginPage (/v/...) are sibling screens in the PublicScreens RootStack (PublicScreens.tsx:32-53). Landing directly on /v/... never pushes TAB_NAVIGATOR, so there is nothing to go back to.
The 2FA path in the same file already documents and works around this exact behavior — it explicitly notes "navigate/goBack no-op from the public /v/ route" and instead resets the stack to TAB_NAVIGATOR (ValidateLoginPage/index.web.tsx:119-130).
Bug manifestation:
Open /v/<accountID>/<validateCode> in a fresh tab → RootStack has only VALIDATE_LOGIN at index 0.
Click "request one here" → beginSignIn() runs, goBack is queued.
goBack(): no backToRoute, canGoBack() is false → logs and returns. No navigation.
Modal stays mounted → user sees nothing change.
What changes do you think we should make in order to solve the problem?
In the "request one here" onPress, after calling beginSignIn(login), surface the sign-in page the same way the 2FA path does instead of relying on goBack(). Reset the public stack to the navigator that hosts SignInPage so the magic-code entry form is shown:
Replace the Navigation.goBack call with navigationRef.reset({index: 0, routes: [{name: NAVIGATORS.TAB_NAVIGATOR}]}) (guarded by Navigation.isNavigationReady()), mirroring ValidateLoginPage/index.web.tsx:119-130.
This makes the link work whether /v/... is the stack root (fresh tab) or has history (same session), landing the user on the sign-in page with the newly requested code.
What alternative solutions did you explore? (Optional)
Pass an explicit fallback route to goBack (e.g. Navigation.goBack(ROUTES.HOME)), but that doesn't target the sign-in page and wouldn't render the code-entry form; the reset to TAB_NAVIGATOR is the pattern already proven for the 2FA case.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/90929) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
On web Chrome, opening a stale magic-code link in a new browser tab shows the "Magic code expired" page, but clicking the "request one here" link does nothing visible — the user stays on the same expired page and cannot enter a fresh magic code. Expected: a sign-in page with a magic-code input is shown so the user can complete sign-in with the newly requested code.
What is the root cause of that problem?
The "request one here" link in ExpiredValidateCodeModal runs two actions: a beginSignIn API call to request a new code, and a navigation step that tries to leave the expired-code page.
The navigation step calls Navigation.setNavigationActionToMicrotaskQueue(Navigation.goBack) — that is, Navigation.goBack() with no fallback route.
In the bug's repro, the user pastes the magic-code URL into a brand-new tab, so this tab's React Navigation stack has only one entry (the /v/<accountID>/<validateCode> deep link). When Navigation.goBack() runs with no fallback, the implementation reaches the no-history branch:
There, navigationRef.current?.canGoBack() returns false because the tab has no prior screen, so goBack just logs [Navigation] Unable to go back and returns. The user remains on /v/..., and because ValidateLoginPage keeps rendering ExpiredValidateCodeModal whenever autoAuthState === FAILED, the page does not change — even though beginSignIn did fire and a new code was actually emailed.
{/* If session.autoAuthState isn't available yet, we use shouldStartSignInWithValidateCode to conditionally render the component instead of local autoAuthState which contains a default value of NOT_STARTED */}
So the visible behavior is "nothing happens", but the underlying cause is that the navigation step has no fallback for a tab that was opened directly via deep link.
What changes do you think we should make in order to solve the problem?
In ExpiredValidateCodeModal.tsx, pass a fallback route to Navigation.goBack so the link works regardless of whether the tab has prior history.
Specifically, change the link's onPress so that, after calling beginSignIn(credentials.login), the deferred navigation call is Navigation.goBack(ROUTES.HOME) instead of Navigation.goBack. The new argument is the backToRoute parameter — when provided, Navigation routes through goUp(backToRoute) instead of through the canGoBack() branch, so it always navigates somewhere meaningful:
Same-tab case (user clicked the magic link from inside the app and there is history): the behavior is the same as today — the user lands back at the sign-in entry point. ROUTES.HOME resolves to the same destination they would have popped to.
New-tab / fresh-context case (the bug's repro): instead of becoming a no-op, navigation REPLACEs the current /v/... deep-link route with the home/sign-in route. That route's sign-in flow already knows how to render the magic-code input for the email currently stored in credentials.login, and because beginSignIn just fired, the freshly issued code from the user's inbox is the valid one.
This is a small change confined to ExpiredValidateCodeModal.tsx — the deferred call becomes () => Navigation.goBack(ROUTES.HOME) in the existing onPress callback, plus a one-line ROUTES import at the top of the file. No other files need to change. The deferred setNavigationActionToMicrotaskQueue wrapper is kept so the new code request's Onyx update still flushes before navigation runs.
What alternative solutions did you explore? (Optional)
Resetting autoAuthState to NOT_STARTED on click was considered, since that would cause ValidateLoginPage to swap ExpiredValidateCodeModal for ValidateCodeModal in place. It was rejected because the URL would still be /v/<expired-code> — confusing if the page is reloaded, and bookmarkable to a known-broken state. Navigating to ROUTES.HOME both updates the URL and re-enters the normal sign-in surface, which is what the bug report expects to see.
goBack() with no fallback route no-ops when /v/<accountID>/<validateCode> is the stack root (magic link pasted into a fresh tab), so canGoBack() is false and the expired modal never leaves the screen → "nothing happens." This is exactly the line PR #96502 replaced with the reset-to-TAB_NAVIGATOR fix.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
sandipanghos commentedon Jun 1, 2026
@jponikarchuk can i start working on this issue. will it be added as paid/external/help wanted list.
MelvinBot commentedon Jul 17, 2026
Proposal
What is the root cause of that problem?
When a magic-link URL (
/v/<accountID>/<validateCode>) is opened directly in a fresh tab, that/v/...route becomes the root of the navigation stack — there is nothing behind it.On the "Magic code expired" page, the "request one here" link fires two actions (
ExpiredValidateCodeModal.tsx:46-48):beginSignIn()requests a new code in the background, but the UI transition depends entirely onNavigation.goBack(). From the root/v/...route there is no previous screen, sogoBack()hits its no-op guard, logs[Navigation] Unable to go back, and returns without navigating (Navigation.ts:518-552). The expired-code modal stays mounted → "nothing happens."This is why the bug only reproduces in a new tab: when the user was already on the sign-in page in the same session,
TAB_NAVIGATOR(which hostsSignInPage) sits below/v/in the stack, sogoBack()succeeds and reveals the code-entry form.Evidence / data flow
SignInPage(the magic-code entry form) andValidateLoginPage(/v/...) are sibling screens in thePublicScreensRootStack (PublicScreens.tsx:32-53). Landing directly on/v/...never pushesTAB_NAVIGATOR, so there is nothing to go back to.TAB_NAVIGATOR(ValidateLoginPage/index.web.tsx:119-130).Bug manifestation:
/v/<accountID>/<validateCode>in a fresh tab → RootStack has onlyVALIDATE_LOGINat index 0.autoAuthState === FAILED, not 2FA →ExpiredValidateCodeModalrenders.beginSignIn()runs,goBackis queued.goBack(): nobackToRoute,canGoBack()isfalse→ logs and returns. No navigation.What changes do you think we should make in order to solve the problem?
In the "request one here"
onPress, after callingbeginSignIn(login), surface the sign-in page the same way the 2FA path does instead of relying ongoBack(). Reset the public stack to the navigator that hostsSignInPageso the magic-code entry form is shown:Navigation.goBackcall withnavigationRef.reset({index: 0, routes: [{name: NAVIGATORS.TAB_NAVIGATOR}]})(guarded byNavigation.isNavigationReady()), mirroringValidateLoginPage/index.web.tsx:119-130.This makes the link work whether
/v/...is the stack root (fresh tab) or has history (same session), landing the user on the sign-in page with the newly requested code.What alternative solutions did you explore? (Optional)
Pass an explicit fallback route to
goBack(e.g.Navigation.goBack(ROUTES.HOME)), but that doesn't target the sign-in page and wouldn't render the code-entry form; theresettoTAB_NAVIGATORis the pattern already proven for the 2FA case.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/90929)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Jul 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (
External)wildan-m commentedon Jul 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On web Chrome, opening a stale magic-code link in a new browser tab shows the "Magic code expired" page, but clicking the "request one here" link does nothing visible — the user stays on the same expired page and cannot enter a fresh magic code. Expected: a sign-in page with a magic-code input is shown so the user can complete sign-in with the newly requested code.
What is the root cause of that problem?
The "request one here" link in
ExpiredValidateCodeModalruns two actions: abeginSignInAPI call to request a new code, and a navigation step that tries to leave the expired-code page.App/src/components/ValidateCode/ExpiredValidateCodeModal.tsx
Lines 39 to 46 in d8068e7
The navigation step calls
Navigation.setNavigationActionToMicrotaskQueue(Navigation.goBack)— that is,Navigation.goBack()with no fallback route.In the bug's repro, the user pastes the magic-code URL into a brand-new tab, so this tab's React Navigation stack has only one entry (the
/v/<accountID>/<validateCode>deep link). WhenNavigation.goBack()runs with no fallback, the implementation reaches the no-history branch:App/src/libs/Navigation/Navigation.ts
Lines 509 to 536 in d8068e7
There,
navigationRef.current?.canGoBack()returnsfalsebecause the tab has no prior screen, sogoBackjust logs[Navigation] Unable to go backand returns. The user remains on/v/..., and becauseValidateLoginPagekeeps renderingExpiredValidateCodeModalwheneverautoAuthState === FAILED, the page does not change — even thoughbeginSignIndid fire and a new code was actually emailed.App/src/pages/ValidateLoginPage/index.web.tsx
Lines 82 to 95 in d8068e7
So the visible behavior is "nothing happens", but the underlying cause is that the navigation step has no fallback for a tab that was opened directly via deep link.
What changes do you think we should make in order to solve the problem?
In
ExpiredValidateCodeModal.tsx, pass a fallback route toNavigation.goBackso the link works regardless of whether the tab has prior history.Specifically, change the link's
onPressso that, after callingbeginSignIn(credentials.login), the deferred navigation call isNavigation.goBack(ROUTES.HOME)instead ofNavigation.goBack. The new argument is thebackToRouteparameter — when provided,Navigationroutes throughgoUp(backToRoute)instead of through thecanGoBack()branch, so it always navigates somewhere meaningful:ROUTES.HOMEresolves to the same destination they would have popped to./v/...deep-link route with the home/sign-in route. That route's sign-in flow already knows how to render the magic-code input for the email currently stored incredentials.login, and becausebeginSignInjust fired, the freshly issued code from the user's inbox is the valid one.This is a small change confined to
ExpiredValidateCodeModal.tsx— the deferred call becomes() => Navigation.goBack(ROUTES.HOME)in the existingonPresscallback, plus a one-lineROUTESimport at the top of the file. No other files need to change. The deferredsetNavigationActionToMicrotaskQueuewrapper is kept so the new code request's Onyx update still flushes before navigation runs.Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/90929-magic-code-expired-request-one-here?expand=1
What alternative solutions did you explore? (Optional)
Resetting
autoAuthStatetoNOT_STARTEDon click was considered, since that would causeValidateLoginPageto swapExpiredValidateCodeModalforValidateCodeModalin place. It was rejected because the URL would still be/v/<expired-code>— confusing if the page is reloaded, and bookmarkable to a known-broken state. Navigating toROUTES.HOMEboth updates the URL and re-enters the normal sign-in surface, which is what the bug report expects to see.29 remaining items
MelvinBot commentedon Jul 28, 2026
The regression was introduced by #45456 ("Update the magic code expired page", merged 2024-07-26).
That PR added the "request one here" link to
ExpiredValidateCodeModalwith a bareNavigation.goBack()(introduced here):goBack()with no fallback route no-ops when/v/<accountID>/<validateCode>is the stack root (magic link pasted into a fresh tab), socanGoBack()isfalseand the expired modal never leaves the screen → "nothing happens." This is exactly the line PR #96502 replaced with thereset-to-TAB_NAVIGATORfix.mkhutornyi commentedon Jul 28, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/45456/changes#r3668336368
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/666583
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-0638-a104-f09e-b7bf0b4b3fb4melvin-bot commentedon Jul 28, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 28, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jul 30, 2026
Payment Summary
Contributor+: @mkhutornyi due $250 via NewDot
^ Test case created. Thx
trjExpensify commentedon Aug 3, 2026
approved $250 for @mkhutornyi