Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.3.68-1
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod - Provide reasoning.
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176927/test-cases/41237626
Email or phone of affected tester (no customers): lattelover1412+od0605aa@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Win11. Android OS15
App Component: Other
Action Performed:
****Precondition:
On Web, sign in with a new account on OldDot (staging.expensify.com)
Logout and sign in again with the same account to validate it with a
magic code
Create a Collect Workspace
Create a new report
Add some expense to the report and submit it
Open the console and run the following snippet: NVP.set('tryNewDot', {classicRedirect: {dismissed: false, timestamp: '2024-01-07'}, nudgeMigration: {timestamp: '2024-01-07'}});
- Launch the app
- Logged in with the same account set up in the precondition section
- Verify that the "Welcome to New Expensify!" modal is displayed (If the modal is not displayed, close the app then reopen the app)
- Tap "Let's go!"
Expected Result:
User should direct to Report page after user tap "Let's go!"
Actual Result:
step 6: user is not directed to Report page after user tap "Let's go!!"
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
Screenshots/Videos
Video.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022052331749293616766
- Upwork Job ID: 2052331749293616766
- Last Price Increase: 2026-05-07
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
MelvinBot commentedon May 7, 2026
Proposal
What is the root cause of that problem?
When the
MigratedUserWelcomeModalGuardredirects a nudge-migrated user to the welcome modal, it triggers a full navigation state RESET viaRootStackRouter.ts:97-109. The new navigation state is built bygetAdaptedStateFromPath, which callsgetDefaultFullScreenRoute. Since the modal route has noreportIDparameter, this defaults toTabNavigator(HOME)underneath the modal overlay.When the user taps "Let's go!",
FeatureTrainingModal.closeModal()callsNavigation.goBack()which pops the modal, revealing the HOME tab. TheMigratedUserWelcomeModal.onCloseonly callsdismissProductTraining— there is no post-dismiss navigation to the user's reports or inbox.In contrast, the standard onboarding flow uses
navigateAfterOnboardingwhich finds the last accessed report and navigates to it. The migrated-user flow lacks this entirely.What changes do you think we should make in order to solve the problem?
Add post-dismiss navigation in
MigratedUserWelcomeModal.onCloseto navigate the user to their last accessed report (similar to hownavigateAfterOnboardingworks). AfterdismissProductTraining, callNavigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID))using the last accessed report fromReportUtils.findLastAccessedReport(), or fall back to the inbox/reports split navigator if no report is found.What alternative solutions did you explore? (Optional)
An alternative would be to modify
getDefaultFullScreenRouteto useNAVIGATORS.REPORTS_SPLIT_NAVIGATORinstead ofSCREENS.HOMEas the default underlying route when the focused route is the migrated-user modal. However, this would change behavior more broadly for the navigation system and is less targeted than adding explicit post-dismiss navigation in the modal's close handler.Supporting evidence
Full data flow:
tryNewDotwithnudgeMigration.timestampsetOnboardingGuardskips onboarding for migrated users (isMigratedUser=true)MigratedUserWelcomeModalGuardreturns REDIRECT to the welcome modal[TabNavigator(HOME), MIGRATED_USER_MODAL_NAVIGATOR]goBack()pops modal → user lands on HOME, not on their reportPossibly related issue: Expensify/App#89010 — "Onboarding modal is not shown after redirecting from OD" — also involves the OldDot-to-NewDot transition and onboarding modal behavior for migrated users.
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.KJ21-ENG commentedon May 7, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-07 12:25:42 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After the OldDot-to-NewDot mobile transition, migrated users see the "Welcome to New Expensify!" modal. Tapping "Let's go!" should dismiss that modal and reveal the report created in the transition flow, but Android lands on Home instead.
What is the root cause of that problem?
MigratedUserWelcomeModalGuardredirects migrated users to the welcome modal without abackTopath.App/src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts
Lines 86 to 93 in dfe7f59
RootStackRouterconverts that guard redirect into a reset state fromgetAdaptedStateFromPath().App/src/libs/Navigation/AppNavigator/createRootStackNavigator/RootStackRouter.ts
Lines 97 to 109 in dfe7f59
The adapter already has a
backTobranch that can build the full-screen route underneath a modal, but with nobackToit falls through togetDefaultFullScreenRoute(). Since the migrated-user modal has noreportID, the default route is Home.App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Lines 100 to 126 in dfe7f59
App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Lines 277 to 290 in dfe7f59
App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Lines 383 to 386 in dfe7f59
Then
FeatureTrainingModal.closeModal()callsNavigation.goBack()beforeMigratedUserWelcomeModal.onClose()only dismisses the product training flag, so "Let's go!" can only reveal the Home underlay that the reset created.App/src/components/FeatureTrainingModal.tsx
Lines 339 to 360 in dfe7f59
App/src/components/MigratedUserWelcomeModal.tsx
Lines 49 to 60 in dfe7f59
Using
LAST_VISITED_PATHis not sufficient by itself for this repro. The HybridApp settings imported from OldDot only includeHYBRID_APP, optionalNVP_TRY_NEW_DOT, and optional staging-server state, so a user who created the report on OldDot Web and then first opens Android NewDot can have no NewDotLAST_VISITED_PATH.App/src/libs/actions/HybridApp/types.ts
Lines 5 to 9 in dfe7f59
What changes do you think we should make in order to solve the problem?
In
MigratedUserWelcomeModalGuard, add a module-levelOnyx.connectWithoutViewsubscription toONYXKEYS.LAST_VISITED_PATH, mirroring the existing module-level NVP subscriptions. In the migrated-user redirect branch, always pass abackToto the modal route: uselastVisitedPathwhen it is present, otherwise useROUTES.INBOX.That makes the route
ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(lastVisitedPath || ROUTES.INBOX). When a real NewDot path exists, the modal preserves that exact underlay. When this OldDot-Web-first repro has no NewDot path,ROUTES.INBOXresolves through the existing Reports split navigator, whose initial report logic selectsfindLastAccessedReport()on Android native becausegetCurrentUrl()is empty there.App/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx
Lines 32 to 55 in dfe7f59
App/src/libs/Navigation/currentUrl/index.native.ts
Lines 1 to 5 in dfe7f59
Update
tests/unit/Navigation/guards/MigratedUserWelcomeModalGuard.test.tsso the existing no-last-visited-path redirect expectsROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(ROUTES.INBOX), and add a regression case whereONYXKEYS.LAST_VISITED_PATH = ROUTES.REPORT_WITH_ID.getRoute(reportID)asserts that exact report path is passed asbackTo.Scope boundaries: Files touched:
src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.tsfor theLAST_VISITED_PATHmodule cache and redirect route construction inevaluate();tests/unit/Navigation/guards/MigratedUserWelcomeModalGuard.test.tsfor the redirect expectation and one report-path regression case. Platforms: Android native HybridApp repro, with shared migrated-user modal guard behavior. Code paths not touched:FeatureTrainingModal,MigratedUserWelcomeModal.onClose,navigateAfterOnboarding,getAdaptedStateFromPath, report creation/submission, OldDot/native bridge settings. API/backend changes: none.What alternative solutions did you explore? (Optional)
My earlier
LAST_VISITED_PATH-only fix preserves an existing NewDot path but misses this exact repro when the user has no NewDot path history. TheROUTES.INBOXfallback closes that gap while still preservingLAST_VISITED_PATHwhen it exists.MelvinBot and some human proposals suggested navigating from
MigratedUserWelcomeModal.onClose()after dismissal. That addresses the symptom, but it duplicates destination recovery in the component and creates a second navigation afterFeatureTrainingModalhas already scheduledNavigation.goBack(). Building the correct underlay in the guard uses the existing modalbackTocontract instead.Another alternative is changing
getDefaultFullScreenRoute()to default modal routes to the Reports split navigator, but that helper is shared by many modal and guard-reset paths. Localizing the fallback to the migrated-user guard keeps the broader navigation default unchanged.melvin-bot commentedon May 7, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)yusufdeveloper2903 commentedon May 7, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-07 10:43:22 UTC.
Proposal
What is the root cause of that problem?
The migrated-user welcome modal pops up via
MigratedUserWelcomeModalGuard.evaluate()returning aREDIRECTtoROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute()— with nobackToparameter:https://github.com/Expensify/App/blob/main/src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts#L86-L93
RootStackRouter.handleNavigationGuardsturns that redirect into aCommonActions.reset(...)whose payload is built bygetAdaptedStateFromPath:https://github.com/Expensify/App/blob/main/src/libs/Navigation/AppNavigator/createRootStackNavigator/RootStackRouter.ts#L97-L110
Inside
getAdaptedState, the migrated-user modal is not a full-screen route, so it falls through togetMatchingFullScreenRoute(focusedRoute). That helper has a dedicatedbackTobranch — feed it a path and it resolves the underlying full-screen route from that path:https://github.com/Expensify/App/blob/main/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts#L100-L127
But because we passed no
backTo, the modal route doesn't match any of theRHP_TO_*maps either, sogetMatchingFullScreenRoutereturnsundefined, andgetAdaptedStatefalls all the way through togetDefaultFullScreenRoute(focusedRoute). The modal route has noreportID, so the default branch picksSCREENS.HOME— the standalone Home landing tab, notNAVIGATORS.REPORTS_SPLIT_NAVIGATOR:https://github.com/Expensify/App/blob/main/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts#L277-L291
The reset payload is therefore
[TabNavigator(SCREENS.HOME), MIGRATED_USER_MODAL_NAVIGATOR]. When the user taps "Let's go!",FeatureTrainingModal.closeModalrunsNavigation.goBack()and thenonClose():https://github.com/Expensify/App/blob/main/src/components/FeatureTrainingModal.tsx#L339-L365
MigratedUserWelcomeModal.onCloseonly callsdismissProductTraining— no navigation:https://github.com/Expensify/App/blob/main/src/components/MigratedUserWelcomeModal.tsx#L58-L61
So
goBack()pops the modal and reveals theSCREENS.HOMElanding tab that the guard reset baked into the underlay. The user never reaches the report from the precondition.The deep-link path (initial URL =
/onboarding/migrated-user-welcome) doesn't have this bug, becauseNavigationRoot.initialStatealready constructs the right state usinglastVisitedPathas the underlay before pushing the modal:https://github.com/Expensify/App/blob/main/src/libs/Navigation/NavigationRoot.tsx#L111-L119
The guard-redirect path is the one that's missing this construction.
What changes do you think we should make in order to solve the problem?
Have the guard supply a
backTosogetMatchingFullScreenRoute's existing backTo branch resolves the underlay. PreferLAST_VISITED_PATH(matches the deep-link precedent inNavigationRoot.initialState), and fall back toROUTES.INBOXwhen the path is empty — this is the case in the bug repro, where the user signed up entirely on OldDot Web and has never visited NewDot, soLAST_VISITED_PATHis unset.ROUTES.INBOXresolves throughgetStateFromPath('inbox')to aTabNavigatorwithREPORTS_SPLIT_NAVIGATORselected.ReportsSplitNavigatoralready runsfindLastAccessedReportfor its initial report when no reportID is in the URL:https://github.com/Expensify/App/blob/main/src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx#L32-L56
So the underlay built at REDIRECT time becomes
TabNavigator → ReportsSplitNavigator → Inbox + REPORT(reportID = lastAccessedReportID), andNavigation.goBack()from the modal reveals the user's last accessed report — i.e. the report from the precondition. No secondNavigation.navigateis needed inonClose, and we don't race withcloseModal'sgoBack.if (hasBeenAddedToNudgeMigration && !isProductTrainingElementDismissed('migratedUserWelcomeModal', dismissedProductTraining)) { Log.info('[MigratedUserWelcomeModalGuard] Redirecting to migrated user welcome modal'); hasRedirectedToMigratedUserModal = true; + // Pass backTo so getMatchingFullScreenRoute resolves the underlay to the user's + // last visited path; fall back to the inbox so ReportsSplitNavigator picks the + // last accessed report for fresh OldDot→NewDot migrations where LAST_VISITED_PATH is empty. + const backTo = lastVisitedPath || ROUTES.INBOX; + return { type: 'REDIRECT', - route: ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(), + route: ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(backTo), }; }Supporting changes (no extra diffs needed):
MigratedUserWelcomeModal.onCloseandFeatureTrainingModal.closeModalare unchanged. The fix relies entirely on building the right underlay at REDIRECT time, so the existinggoBack()dismissal path Just Works.tests/unit/Navigation/guards/MigratedUserWelcomeModalGuard.test.tsassertion that the redirect equalsROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute()(line ~66) needs to be updated to expectgetRoute(ROUTES.INBOX)for the no-LAST_VISITED_PATHcase, plus a new case asserting that whenONYXKEYS.LAST_VISITED_PATH = ROUTES.REPORT_WITH_ID.getRoute(reportID)the redirect uses that path asbackTo.What alternative solutions did you explore? (Optional)
Use
LAST_VISITED_PATHonly asbackTo(the surgical guard-time fix without the inbox fallback). Mechanism is correct, but it doesn't fix this specific repro: the user's NewDot session has no path history because the precondition was performed entirely on OldDot Web, soLAST_VISITED_PATHis empty and the guard would still redirect with nobackTo→getDefaultFullScreenRoutestill picksSCREENS.HOME. Adding theROUTES.INBOXfallback closes this gap without losing the deep-link-friendlylastVisitedPathbehavior.Call
navigateAfterOnboardingWithMicrotaskQueuefromonClose. This works on the surface, but it's the wrong-shaped fix: (a) the helper is semantically about onboarding-completion (it branches ononboardingPolicyID,onboardingAdminsChatReportID,TRACK_EXPENSES_WITH_CONCIERGE,shouldOpenRHPVariant,setDisableDismissOnEscape— none of which apply to nudge-migrated users), and (b) it produces a two-step navigation:closeModalalready callsNavigation.goBack()(popping the modal back to theSCREENS.HOMEunderlay), then the helper callsNavigation.dismissModal()(no-op) and queues aNavigation.navigate(ROUTES.REPORT_WITH_ID...)in a microtask. Building the correct underlay once at REDIRECT time keeps the existing dismiss flow unchanged and avoids that race surface.Reinstate the
Navigation.navigate(SEARCH_ROOT)call from Show migrated user welcome modal immediately and navigate to Home on dismiss #86733 inonClose. Rejected — that's the approach reverted by Revert "Show migrated user welcome modal immediately and navigate to Home on dismiss" #88687 because it caused OD transition - "Welcome to Expensify" modal appears every time after refreshing the app #88686 (modal reappearing on every cold start). Any fix that recycles it has to also re-introduce the dismissal-state-loaded gate that originally made it unsafe; thebackToapproach above sidesteps both problems.Change
getDefaultFullScreenRouteto returnNAVIGATORS.REPORTS_SPLIT_NAVIGATORinstead ofSCREENS.HOMEfor routes with noreportID. One-line change that would also fix this bug, but it's a fallback used by every guard redirect / modal that doesn't set its ownbackTo, so the blast radius is much wider than the migrated-user flow. Localizing the fix to the guard keeps that helper's contract intact.[-]OldDot transition- user is not directed to Report page after tap "Lets go!"[/-][+][$250] OldDot transition- user is not directed to Report page after tap "Lets go!"[/+]melvin-bot commentedon May 7, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022052331749293616766
aswin-s commentedon May 7, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-07 10:29:43 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After an OldDot-to-NewDot transition, migrated users see the "Welcome to New Expensify!" modal. When they tap "Let's go!", the app should take them to the report page from the transition flow, but it instead lands on the empty Home screen.
What is the root cause of that problem?
There are two connected pieces:
MigratedUserWelcomeModalGuardreturns aREDIRECTtoROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute().App/src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts
Lines 86 to 93 in d8bbee9
RootStackRouter.handleNavigationGuardshandles that redirect by converting the route into a navigation state and dispatchingCommonActions.reset(...).App/src/libs/Navigation/AppNavigator/createRootStackNavigator/RootStackRouter.ts
Lines 97 to 110 in d8bbee9
Because the migrated-user modal route has no
reportIDand nobackTo,getAdaptedStateFromPath()falls through togetDefaultFullScreenRoute(), which injectsSCREENS.HOMEunder the modal.App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts
Lines 277 to 291 in d8bbee9
Then
FeatureTrainingModal.closeModal()callsNavigation.goBack()before running the providedonClosecallback, so dismissing the modal reveals that Home underlay.App/src/components/FeatureTrainingModal.tsx
Lines 339 to 365 in d8bbee9
The direct missing step is in
MigratedUserWelcomeModal.onClose(): it only callsdismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL). It does not navigate to the report page after the modal is dismissed.App/src/components/MigratedUserWelcomeModal.tsx
Lines 57 to 61 in d8bbee9
This is why simply dismissing the modal is not enough. The stack already has Home underneath it, so the migrated-user flow needs the same final destination selection that the normal onboarding flow uses. That existing path is
navigateAfterOnboardingWithMicrotaskQueue()->navigateAfterOnboarding()->getReportIDAfterOnboarding(), which finds the last accessed report on small screens and falls back to Home only when there is no suitable report.App/src/libs/navigateAfterOnboarding.ts
Lines 29 to 127 in d8bbee9
What changes do you think we should make in order to solve the problem?
Update
src/components/MigratedUserWelcomeModal.tsxso dismissing the migrated-user modal reuses the existing post-onboarding navigation helper instead of leaving the user on the Home underlay.Implementation:
navigateAfterOnboardingWithMicrotaskQueue()already callsNavigation.dismissModal()and queues the report navigation. That is useful here becauseFeatureTrainingModal.closeModal()has already scheduledNavigation.goBack()before invokingonClose; the helper defers the final report navigation instead of racing the modal pop.Do not set
shouldGoBack={false}for this fix. The current modal flow already usesFeatureTrainingModal's normal close behavior to remove the modal, and the missing piece is the destination after that close. Replacing the close behavior risks changing modal semantics unnecessarily.Tests
Add focused coverage for
MigratedUserWelcomeModal:navigateAfterOnboardingWithMicrotaskQueue.dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL)is called.navigateAfterOnboardingWithMicrotaskQueue(isSmallScreenWidth, canUseDefaultRooms, conciergeReportID, archivedReportsIdSet)is called.FeatureTrainingModal.This catches the exact regression: dismissing the modal must trigger report-selection navigation, not just modal dismissal.
What alternative solutions did you explore? (Optional)
Add only
Navigation.dismissModal()inMigratedUserWelcomeModal.onClose: Rejected. It dismisses the modal but does not choose the expected report page, so the user can still remain on the Home underlay created by the guard reset.Pass
shouldGoBack={false}toFeatureTrainingModal: Rejected for the same reason. It changes how the modal closes, but the missing behavior is post-dismiss destination selection.Use
ONYXKEYS.LAST_VISITED_PATHas the modalbackToinMigratedUserWelcomeModalGuard: Plausible but weaker.MIGRATED_USER_WELCOME_MODAL.getRoute(backTo)does support abackTo, but this fix depends onLAST_VISITED_PATHbeing hydrated and pointing to the report from this OldDot transition. The existing onboarding helper is more robust because it computes the destination from current report data and handles archived reports, self-DM, Concierge, and default-room filtering.Navigate to Expense Reports search after dismiss: Rejected as too broad. The issue expects the report page from the transition flow, not just a generic reports/search destination.
Change
RootStackRouterorgetAdaptedStateFromPath(): Rejected because that affects shared navigation behavior for guard redirects and modal routes. The low-risk fix is at the migrated-user modal exit point, where the missing post-dismiss navigation belongs.trasnake87 commentedon May 7, 2026
Proposal
When a nudge-migrated user dismisses the "Welcome to New Expensify!" modal with "Let's go!", they are dropped on whatever was rendered as the fallback under the modal (the HOME tab) instead of the report they created in the precondition. The migrated-user flow lacks the post-dismiss navigation that the regular onboarding flow has.
Root cause
The flow has two contributing pieces, and they need to be addressed together:
1 — The redirect builds a HOME-fallback state, not a state pointing at the user's last report.
MigratedUserWelcomeModalGuardreturns aREDIRECTtoROUTES.MIGRATED_USER_WELCOME_MODAL(src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts:86-94).RootStackRouter.handleNavigationGuardsconsumes the redirect and resets the stack to whatevergetAdaptedStateFromPathproduces for that route (src/libs/Navigation/AppNavigator/createRootStackNavigator/RootStackRouter.ts:97-110):Because
MIGRATED_USER_WELCOME_MODALis a basic-modal route with noreportID, the adapted state is[ReportsSplit(HOME)] + [MigratedUserWelcomeModal]. This is the only thing under the modal — no specific report is targeted.2 —
MigratedUserWelcomeModal.onClosedoes not navigate after dismissing.src/components/MigratedUserWelcomeModal.tsx:58-61only callsdismissProductTraining:FeatureTrainingModal.closeModal(src/components/FeatureTrainingModal.tsx:340-367) runsNavigation.goBack()and then thisonClose, so the modal is popped back to the underlying HOME tab and the flow ends there. By contrast, every standard onboarding screen (BaseOnboardingPersonalDetails,BaseOnboardingWorkspaceInvite,BaseOnboardingInterestedFeatures,BaseOnboardingWorkspaceOptional,useAutoCreateTrackWorkspace, etc.) ends withnavigateAfterOnboardingWithMicrotaskQueuewhich resolves to the user's last-accessed report viafindLastAccessedReport(src/libs/navigateAfterOnboarding.ts:27-99,src/libs/ReportUtils.ts:2259-2298):The migrated-user flow has zero equivalent — the bug is exactly that this final navigation is missing. The modal was added behind a guard later than the onboarding flow, and the post-dismiss step was never wired up.
Proposed fix
Replicate the post-onboarding navigation in
MigratedUserWelcomeModal.onClose, using the same helper the rest of the onboarding flow uses so we get the existing edge-case handling (archived report filtering,DEFAULT_ROOMSbeta, RHP variant, admin-room preference,isSmallScreenWidthmobile-vs-large-screen split) for free.Change
src/components/MigratedUserWelcomeModal.tsxas follows:Two notes on
navigateAfterOnboardingWithMicrotaskQueue:Navigation.dismissModal()and then queuesnavigateAfterOnboardingviaNavigation.setNavigationActionToMicrotaskQueue(src/libs/navigateAfterOnboarding.ts:102-125). That is exactly what we want here — the FeatureTrainingModal'sNavigation.goBack()already runs first insideInteractionManager.runAfterInteractions(src/components/FeatureTrainingModal.tsx:352-366); the microtask queue defers the report navigation until after the goBack settles, so we don't race the modal pop and end up on a stale stack frame.onboardingPolicyID/onboardingAdminsChatReportIDbecause nudge-migrated users did not just create an admins chat through onboarding; we want the user's last accessed report (the one they created in the precondition), which is exactly whatfindLastAccessedReportreturns when the admin-room override is omitted.The same pattern needs to apply when the user dismisses via the help button —
onHelpopens an external URL but on web/native that does not unmount the app, and after the modal closes we still want the user on a report rather than a stale HOME tab. Pull the navigation into a shared helper:Why this approach
Reusing
navigateAfterOnboardingWithMicrotaskQueuematches the precedent already established for every other onboarding-completion path in the app (BaseOnboardingPersonalDetails.tsx:127-156,BaseOnboardingWorkspaceInvite.tsx:127-156,useAutoCreateTrackWorkspace.ts:119-128), so the migrated-user "exit" matches the regular-onboarding "exit" semantics: small-screen users land on their last accessed non-archived, non-self-DM, non-Concierge report, large-screen users get sensible defaults, and archived-report and beta gating come along automatically.A narrower fix — hardcoding
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(findLastAccessedReport(...)?.reportID))directly inonClose— would also clear the symptom on Android, but it duplicates the filter logic already centralized ingetReportIDAfterOnboarding, drifts the moment that helper learns about a new edge case (RHP variants, archived sets, theTRACK_EXPENSES_WITH_CONCIERGEredirect), and would need its own "fall back to HOME" branch (src/libs/navigateAfterOnboarding.ts:96-99). Routing through the existing helper avoids the drift.We do not need to change
RootStackRouterorgetAdaptedStateFromPathto make the redirect itself land on a report. The modal is correctly an overlay on top of HOME — the bug is strictly that we never navigate away from that overlay's underlay when the user dismisses. Fixing the dismiss handler is the smaller, lower-risk surface.David-2002065 commentedon May 7, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After the OldDot→NewDot transition, a nudge-migrated user sees the "Welcome to New Expensify!" modal. Following the revert of #90134, the product intent (per @trjExpensify) is that tapping "Let's go!" lands them on the Spend page for their first session — not a specific report, and not the Home tab. On the OldDot→NewDot transition path the user can still be left on the Home tab that sits under the modal.
What is the root cause of that problem?
The migrated-user modal is a dynamic route whose underlay is built from the current active route, falling back to Home:
App/src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts
Lines 32 to 34 in 4009bda
On a cold OldDot→NewDot launch the active route is the Home tab, so the modal is layered over Home and the navigation state is effectively
[TabNavigator(HOME), MIGRATED_USER_MODAL]. The Spend page is never part of the state the modal is built on.Reaching Spend is instead delegated to an imperative post-dismiss navigation in the modal's close handler:
App/src/components/MigratedUserWelcomeModal.tsx
Lines 67 to 72 in 4009bda
So the destination is only correct if
goBack()first reveals the Home underlay and the deferredafterTransitioncallback then firesNavigation.navigate(spendRoute). That briefly flashes Home, and the landing depends on that deferred callback running after the modal pop. #95399 added this handler for the demo-completion flow (#95228, verified on desktop web), but it patches the destination after dismissal rather than building the correct underlay — so the OldDot→NewDot transition path still constructs a Home underlay instead of a Spend one.What changes do you think we should make in order to solve the problem?
Build the Spend page as the modal's underlay at construction time, so dismissing the modal reveals Spend directly — satisfying the revert constraint by construction instead of relying on a deferred post-dismiss navigate.
In
getMigratedUserWelcomeModalRoute(MigratedUserWelcomeModalGuard.ts), default thebasePathto the canned Expense Reports search route (the Spend page), which is already a registeredentryScreen(SCREENS.SEARCH.ROOT) for this dynamic route:With the underlay now the Spend page,
MigratedUserWelcomeModal.handleCloseno longer needs the imperative navigate and can simply pop the modal (dismissal is still persisted by the existinguseBeforeRemove(persistDismissal)):This removes the Home flash, makes the Spend landing part of the navigation state itself (robust across the guard-reset and proactive-navigation paths and across platforms), and keeps a single source of truth for the destination.
What alternative solutions did you explore? (Optional)
handleClosenavigate (status quo from Fix "Let's go" migrate welcome button redirects to Inbox instead of Spend page after completing the demo #95399). It reaches Spend in the demo flow, but it leaves the Home underlay in place, flashes Home, and depends on the deferred callback firing on the guard-reset stack — which is exactly the transition path this issue is about.LAST_VISITED_PATH/ROUTES.INBOXas the underlay (earlier proposals here). Inbox is not the product-intended destination, andLAST_VISITED_PATHis empty for an OldDot-Web-first migration, so it would fall back to the wrong page.20 remaining items
grgia commentedon May 27, 2026
@eVoloshchak picking this up after the auto-assign. What's the status here?
trjExpensify commentedon May 28, 2026
#90134 (comment) - commented in the PR, let's CP a revert ASAP tomorrow please. CC: @jamesdeanexpensify
eVoloshchak commentedon May 28, 2026
Revert PR is at #91934
melvin-bot commentedon Jun 22, 2026
This issue has not been updated in over 15 days. @eVoloshchak, @grgia eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
grgia commentedon Aug 12, 2026
Checking in since the revert. @trjExpensify does this still reproduce on the OldDot to NewDot transition, and do we still want it fixed? If yes, @eVoloshchak let's reopen proposals with the revert reason as a constraint. If not, I will close it out.
David-2002065 commentedon Aug 12, 2026
Some history on this one for @grgia, since you asked whether it still reproduces.
MigratedUserWelcomeModalso "Let's go!" navigates to the Spend page via a post-dismiss handler:App/src/components/MigratedUserWelcomeModal.tsx
Lines 67 to 72 in 4009bda
That handler was added and verified for the demo-completion flow on desktop web. On the OldDot→NewDot transition path the modal's underlay is still built from the active route (Home) rather than the Spend page, and the Spend landing is reached only by a deferred post-dismiss navigate:
App/src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts
Lines 32 to 34 in 4009bda
So the destination now matches Product's decision (Spend, not a report), but on this specific path it depends on that deferred callback firing over a Home underlay. I've updated my proposal above to build the Spend page as the underlay itself, which lands on Spend by construction and removes the Home flash — this keeps the revert constraint (Spend page) as the guiding requirement. Happy to re-run the exact Android TC (41237626) to confirm the current behavior on that path if that's useful before deciding.
trjExpensify commentedon Aug 12, 2026
This is working correctly now, so nothing to do here @grgia.
grgia commentedon Aug 13, 2026
Thanks. Alright, closing this out.