Repository navigation
Fix: Magic code expired page - 'request one here' does nothing in a fresh tab - #96502
Conversation
…pired magic-link page Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
DetailsExplanation of ChangeOn the "Magic code expired" page, the "request one here" link fired This change replaces the history-dependent Added a unit test to Fixed Issues$ #90929 Tests
Offline testsSame as Tests QA StepsSame as Tests
PR Author Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / Safari@MelvinBot please set the PR body to the content in the details section above |
|
🤖 Done — I've set the PR description to the content you provided. |
|
@MelvinBot mark as ready for review |
|
@mkhutornyi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🤖 Done — I've marked this PR as ready for review. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaridemo.mov |
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.41-0 🚀
|
|
🤖 I reviewed this PR against Expensify's help site files under Why: This is a pure bug fix. The "request one here" link on the "Magic code expired" page previously did nothing when a It introduces no new feature, tab, setting, label, or button, and it doesn't change any behavior that the help site describes — it restores the intended, already-documented flow of requesting a new code. The only related articles ( @mkhutornyi, please confirm you agree no help site update is needed here. If you believe a doc should be added or updated, let me know and I'll create the draft PR. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.41-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
On the "Magic code expired" page, the "request one here" link fired
beginSignIn()(which requests a new code in the background) and then relied onNavigation.setNavigationActionToMicrotaskQueue(Navigation.goBack)to surface the sign-in page. When the/v/<accountID>/<validateCode>magic link is opened directly in a fresh tab, that/v/...route is the root of the navigation stack, sogoBack()has nothing to go back to — it hits its no-op guard, logs[Navigation] Unable to go back, and returns. The expired-code modal stays mounted, so the click appears to do nothing.This change replaces the history-dependent
goBackwith a public-stack reset toTAB_NAVIGATOR(which hosts the publicSignInPage), mirroring the already-shipped 2FA workaround in the same subsystem (src/pages/ValidateLoginPage/index.web.tsx). Aresetdoesn't depend on the tab having navigation history, so the link now works 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.Added a unit test to
tests/ui/ValidateLoginPageTest.tsxthat seedsautoAuthState === FAILEDwith a cachedcredentials.login, presses the "request one here" link, and verifiesbeginSignIn(login)is called and the stack resets toTAB_NAVIGATOR.Fixed Issues
$ #90929
PROPOSAL: #90929 (comment)
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari