Skip to content

[$250] OldDot transition- user is not directed to Report page after tap "Lets go!" #89900

Closed

Description

@jponikarchuk

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'}});

  1. Launch the app
  2. Logged in with the same account set up in the precondition section
  3. Verify that the "Welcome to New Expensify!" modal is displayed (If the modal is not displayed, close the app then reopen the app)
  4. 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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022052331749293616766
  • Upwork Job ID: 2052331749293616766
  • Last Price Increase: 2026-05-07

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 7, 2026
  2. MelvinBot commented on May 7, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When the MigratedUserWelcomeModalGuard redirects a nudge-migrated user to the welcome modal, it triggers a full navigation state RESET via RootStackRouter.ts:97-109. The new navigation state is built by getAdaptedStateFromPath, which calls getDefaultFullScreenRoute. Since the modal route has no reportID parameter, this defaults to TabNavigator(HOME) underneath the modal overlay.

    When the user taps "Let's go!", FeatureTrainingModal.closeModal() calls Navigation.goBack() which pops the modal, revealing the HOME tab. The MigratedUserWelcomeModal.onClose only calls dismissProductTraining — there is no post-dismiss navigation to the user's reports or inbox.

    In contrast, the standard onboarding flow uses navigateAfterOnboarding which 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.onClose to navigate the user to their last accessed report (similar to how navigateAfterOnboarding works). After dismissProductTraining, call Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID)) using the last accessed report from ReportUtils.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 getDefaultFullScreenRoute to use NAVIGATORS.REPORTS_SPLIT_NAVIGATOR instead of SCREENS.HOME as 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:

    1. User has NVP tryNewDot with nudgeMigration.timestamp set
    2. OnboardingGuard skips onboarding for migrated users (isMigratedUser=true)
    3. MigratedUserWelcomeModalGuard returns REDIRECT to the welcome modal
    4. REDIRECT triggers a full RESET → nav state becomes [TabNavigator(HOME), MIGRATED_USER_MODAL_NAVIGATOR]
    5. User taps "Let's go!" → goBack() pops modal → user lands on HOME, not on their report

    Possibly 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 this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 7, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 7, 2026
  5. KJ21-ENG commented on May 7, 2026

    @KJ21-ENG
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-05-07 12:25:42 UTC.

    Replaces my earlier proposal. The prior fix used LAST_VISITED_PATH only, but the verified HybridApp payload does not import LAST_VISITED_PATH; in this OldDot-Web-first repro it can be empty, so the guard also needs an ROUTES.INBOX fallback.

    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?

    MigratedUserWelcomeModalGuard redirects migrated users to the welcome modal without a backTo path.

    if (hasBeenAddedToNudgeMigration && !isProductTrainingElementDismissed('migratedUserWelcomeModal', dismissedProductTraining)) {
    Log.info('[MigratedUserWelcomeModalGuard] Redirecting to migrated user welcome modal');
    hasRedirectedToMigratedUserModal = true;
    return {
    type: 'REDIRECT',
    route: ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(),
    };

    RootStackRouter converts that guard redirect into a reset state from getAdaptedStateFromPath().

    if (guardResult.type === 'REDIRECT') {
    const redirectState = getAdaptedStateFromPath(guardResult.route, linkingConfig.config);
    if (!redirectState?.routes) {
    return null;
    }
    const resetAction = CommonActions.reset({
    index: redirectState.index ?? redirectState.routes.length - 1,
    routes: redirectState.routes,
    });
    return stackRouter.getStateForAction(state, resetAction, configOptions);

    The adapter already has a backTo branch that can build the full-screen route underneath a modal, but with no backTo it falls through to getDefaultFullScreenRoute(). Since the migrated-user modal has no reportID, the default route is Home.

    // Check for backTo param. One screen with different backTo value may need different screens visible under the overlay.
    // Dynamic screens are skipped here because they never carry their own backTo - they only
    // inherit it from the screen underneath. Letting backTo dictate the full-screen route for
    // a dynamic screen would resolve the wrong page.
    if (isRouteWithBackToParam(route) && !isDynamicScreen) {
    const stateForBackTo = getStateFromPath(route.params.backTo as RoutePath);
    // This may happen if the backTo url is invalid.
    const lastRoute = stateForBackTo?.routes.at(-1);
    if (!stateForBackTo || !lastRoute || lastRoute.name === SCREENS.NOT_FOUND) {
    return undefined;
    }
    const isLastRouteFullScreen = isFullScreenName(lastRoute.name);
    // If the state for back to last route is a full screen route, we can use it
    if (isLastRouteFullScreen) {
    return lastRoute;
    }
    const focusedStateForBackToRoute = findFocusedRouteWithOnyxTabGuard(stateForBackTo);
    if (!focusedStateForBackToRoute) {
    return undefined;
    }
    // If not, get the matching full screen route for the back to state.
    return getMatchingFullScreenRoute(focusedStateForBackToRoute);

    function getDefaultFullScreenRoute(route?: NavigationPartialRoute) {
    if (route && isRouteWithReportID(route)) {
    const reportID = route.params.reportID;
    // Only allReports should be checked here
    if (!getReportOrDraftReport(reportID, undefined, undefined, {})) {
    return getTabNavigatorState({name: NAVIGATORS.REPORTS_SPLIT_NAVIGATOR});
    }
    const reportsState = getInitialSplitNavigatorState({name: SCREENS.INBOX}, {name: SCREENS.REPORT, params: {reportID}});
    return getTabNavigatorState(reportsState);
    }
    return getTabNavigatorState({name: SCREENS.HOME});

    const defaultFullScreenRoute = getDefaultFullScreenRoute(focusedRoute);
    // If not, add the default full screen route.
    return getRoutesWithIndex([defaultFullScreenRoute, ...currentState.routes]);

    Then FeatureTrainingModal.closeModal() calls Navigation.goBack() before MigratedUserWelcomeModal.onClose() only dismisses the product training flag, so "Let's go!" can only reveal the Home underlay that the reset created.

    const closeModal = () => {
    Log.hmmm(`[FeatureTrainingModal] closeModal called - willShowAgain: ${willShowAgain}, shouldGoBack: ${shouldGoBack}, hasOnClose: ${!!onClose}`);
    if (!willShowAgain) {
    Log.hmmm('[FeatureTrainingModal] Dismissing track training modal');
    setNameValuePair(ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING, true, false);
    }
    Log.hmmm('[FeatureTrainingModal] Setting modal invisible');
    setIsModalVisible(false);
    InteractionManager.runAfterInteractions(() => {
    Log.hmmm(`[FeatureTrainingModal] Running after interactions - shouldGoBack: ${shouldGoBack}, hasOnClose: ${!!onClose}`);
    if (shouldGoBack) {
    Log.hmmm('[FeatureTrainingModal] Navigating back');
    Navigation.goBack();
    }
    if (onClose) {
    Log.hmmm('[FeatureTrainingModal] Calling onClose callback');
    onClose();

    const onHelp = () => {
    Log.info('[MigratedUserWelcomeModal] onHelp called, opening help URL based on admin status and device type');
    const adminUrl = shouldUseNarrowLayout ? CONST.STORYLANE.ADMIN_MIGRATED_MOBILE : CONST.STORYLANE.ADMIN_MIGRATED;
    const employeeUrl = shouldUseNarrowLayout ? CONST.STORYLANE.EMPLOYEE_MIGRATED_MOBILE : CONST.STORYLANE.EMPLOYEE_MIGRATED;
    const helpUrl = isCurrentUserPolicyAdmin ? adminUrl : employeeUrl;
    openExternalLink(helpUrl);
    dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
    };
    const onClose = () => {
    Log.hmmm('[MigratedUserWelcomeModal] onClose called, dismissing product training');
    dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);

    Using LAST_VISITED_PATH is not sufficient by itself for this repro. The HybridApp settings imported from OldDot only include HYBRID_APP, optional NVP_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 NewDot LAST_VISITED_PATH.

    type HybridAppSettings = {
    [ONYXKEYS.HYBRID_APP]: HybridApp;
    [ONYXKEYS.NVP_TRY_NEW_DOT]?: TryNewDot;
    [ONYXKEYS.SHOULD_USE_STAGING_SERVER]?: boolean;
    };

    What changes do you think we should make in order to solve the problem?

    In MigratedUserWelcomeModalGuard, add a module-level Onyx.connectWithoutView subscription to ONYXKEYS.LAST_VISITED_PATH, mirroring the existing module-level NVP subscriptions. In the migrated-user redirect branch, always pass a backTo to the modal route: use lastVisitedPath when it is present, otherwise use ROUTES.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.INBOX resolves through the existing Reports split navigator, whose initial report logic selects findLastAccessedReport() on Android native because getCurrentUrl() is empty there.

    const [initialReportID] = useState(() => {
    // Deep links and REPORT_WITH_ID navigation pass the reportID in nested params,
    // which lets us skip the O(n) findLastAccessedReport scan over all reports.
    if (route.params?.screen === SCREENS.REPORT && route.params.params?.reportID) {
    return route.params.params.reportID;
    }
    const currentURL = getCurrentUrl();
    const isTransitioning = currentURL.includes(ROUTES.TRANSITION_BETWEEN_APPS);
    const reportIdFromPath = currentURL ? new URL(currentURL).pathname.match(CONST.REGEX.REPORT_ID_FROM_PATH)?.at(1) : undefined;
    if (reportIdFromPath) {
    return reportIdFromPath;
    }
    // If we are in a transition, we explicitly do NOT want to load the last accessed report.
    // Returning an empty string here will cause ReportScreen to skip the `openReport` call initially.
    if (isTransitioning) {
    return '';
    }
    const initialReport = ReportUtils.findLastAccessedReport(!isBetaEnabled(CONST.BETAS.DEFAULT_ROOMS), isOpenOnAdminRoom, undefined, archivedReportsIdSet);
    // eslint-disable-next-line rulesdir/no-default-id-values
    return initialReport?.reportID ?? '';

    import type GetCurrentUrl from './types';
    const getCurrentUrl: GetCurrentUrl = () => '';
    export default getCurrentUrl;

    Update tests/unit/Navigation/guards/MigratedUserWelcomeModalGuard.test.ts so the existing no-last-visited-path redirect expects ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(ROUTES.INBOX), and add a regression case where ONYXKEYS.LAST_VISITED_PATH = ROUTES.REPORT_WITH_ID.getRoute(reportID) asserts that exact report path is passed as backTo.

    Scope boundaries: Files touched: src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts for the LAST_VISITED_PATH module cache and redirect route construction in evaluate(); tests/unit/Navigation/guards/MigratedUserWelcomeModalGuard.test.ts for 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. The ROUTES.INBOX fallback closes that gap while still preserving LAST_VISITED_PATH when 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 after FeatureTrainingModal has already scheduled Navigation.goBack(). Building the correct underlay in the guard uses the existing modal backTo contract 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.

  6. melvin-bot commented on May 7, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External)

  7. yusufdeveloper2903 commented on May 7, 2026

    @yusufdeveloper2903
    Contributor

    🚨 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 a REDIRECT to ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute() — with no backTo parameter:

    https://github.com/Expensify/App/blob/main/src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts#L86-L93

    RootStackRouter.handleNavigationGuards turns that redirect into a CommonActions.reset(...) whose payload is built by getAdaptedStateFromPath:

    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 to getMatchingFullScreenRoute(focusedRoute). That helper has a dedicated backTo branch — 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 the RHP_TO_* maps either, so getMatchingFullScreenRoute returns undefined, and getAdaptedState falls all the way through to getDefaultFullScreenRoute(focusedRoute). The modal route has no reportID, so the default branch picks SCREENS.HOME — the standalone Home landing tab, not NAVIGATORS.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.closeModal runs Navigation.goBack() and then onClose():

    https://github.com/Expensify/App/blob/main/src/components/FeatureTrainingModal.tsx#L339-L365

    MigratedUserWelcomeModal.onClose only calls dismissProductTraining — no navigation:

    https://github.com/Expensify/App/blob/main/src/components/MigratedUserWelcomeModal.tsx#L58-L61

    So goBack() pops the modal and reveals the SCREENS.HOME landing 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, because NavigationRoot.initialState already constructs the right state using lastVisitedPath as 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 backTo so getMatchingFullScreenRoute's existing backTo branch resolves the underlay. Prefer LAST_VISITED_PATH (matches the deep-link precedent in NavigationRoot.initialState), and fall back to ROUTES.INBOX when 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, so LAST_VISITED_PATH is unset.

    ROUTES.INBOX resolves through getStateFromPath('inbox') to a TabNavigator with REPORTS_SPLIT_NAVIGATOR selected. ReportsSplitNavigator already runs findLastAccessedReport for 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), and Navigation.goBack() from the modal reveals the user's last accessed report — i.e. the report from the precondition. No second Navigation.navigate is needed in onClose, and we don't race with closeModal's goBack.

     let hasBeenAddedToNudgeMigration = false;
     let dismissedProductTraining: OnyxEntry<DismissedProductTraining>;
    +let lastVisitedPath: string | undefined;
    
     let hasRedirectedToMigratedUserModal = false;
    
     // ...
    
     Onyx.connectWithoutView({
         key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
         callback: (value) => {
             dismissedProductTraining = value;
             if (isProductTrainingElementDismissed('migratedUserWelcomeModal', value)) {
                 hasRedirectedToMigratedUserModal = false;
             }
         },
     });
    
    +Onyx.connectWithoutView({
    +    key: ONYXKEYS.LAST_VISITED_PATH,
    +    callback: (value) => {
    +        lastVisitedPath = value;
    +    },
    +});
     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.onClose and FeatureTrainingModal.closeModal are unchanged. The fix relies entirely on building the right underlay at REDIRECT time, so the existing goBack() dismissal path Just Works.
    • The existing tests/unit/Navigation/guards/MigratedUserWelcomeModalGuard.test.ts assertion that the redirect equals ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute() (line ~66) needs to be updated to expect getRoute(ROUTES.INBOX) for the no-LAST_VISITED_PATH case, plus a new case asserting that when ONYXKEYS.LAST_VISITED_PATH = ROUTES.REPORT_WITH_ID.getRoute(reportID) the redirect uses that path as backTo.

    What alternative solutions did you explore? (Optional)

    • Use LAST_VISITED_PATH only as backTo (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, so LAST_VISITED_PATH is empty and the guard would still redirect with no backTo → getDefaultFullScreenRoute still picks SCREENS.HOME. Adding the ROUTES.INBOX fallback closes this gap without losing the deep-link-friendly lastVisitedPath behavior.

    • Call navigateAfterOnboardingWithMicrotaskQueue from onClose. This works on the surface, but it's the wrong-shaped fix: (a) the helper is semantically about onboarding-completion (it branches on onboardingPolicyID, onboardingAdminsChatReportID, TRACK_EXPENSES_WITH_CONCIERGE, shouldOpenRHPVariant, setDisableDismissOnEscape — none of which apply to nudge-migrated users), and (b) it produces a two-step navigation: closeModal already calls Navigation.goBack() (popping the modal back to the SCREENS.HOME underlay), then the helper calls Navigation.dismissModal() (no-op) and queues a Navigation.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 in onClose. 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; the backTo approach above sidesteps both problems.

    • Change getDefaultFullScreenRoute to return NAVIGATORS.REPORTS_SPLIT_NAVIGATOR instead of SCREENS.HOME for routes with no reportID. 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 own backTo, so the blast radius is much wider than the migrated-user flow. Localizing the fix to the guard keeps that helper's contract intact.

  8. changed the title [-]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!"[/+] on May 7, 2026
  9. melvin-bot commented on May 7, 2026

    @melvin-bot
  10. aswin-s commented on May 7, 2026

    @aswin-s
    Contributor

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

    1. The migrated-user modal is opened by a guard redirect that resets the root navigation state with Home underneath the modal.
    2. The modal's dismiss handler never performs the missing post-dismiss navigation to a report.

    MigratedUserWelcomeModalGuard returns a REDIRECT to ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute().

    if (hasBeenAddedToNudgeMigration && !isProductTrainingElementDismissed('migratedUserWelcomeModal', dismissedProductTraining)) {
    Log.info('[MigratedUserWelcomeModalGuard] Redirecting to migrated user welcome modal');
    hasRedirectedToMigratedUserModal = true;
    return {
    type: 'REDIRECT',
    route: ROUTES.MIGRATED_USER_WELCOME_MODAL.getRoute(),
    };

    RootStackRouter.handleNavigationGuards handles that redirect by converting the route into a navigation state and dispatching CommonActions.reset(...).

    if (guardResult.type === 'REDIRECT') {
    const redirectState = getAdaptedStateFromPath(guardResult.route, linkingConfig.config);
    if (!redirectState?.routes) {
    return null;
    }
    const resetAction = CommonActions.reset({
    index: redirectState.index ?? redirectState.routes.length - 1,
    routes: redirectState.routes,
    });
    return stackRouter.getStateForAction(state, resetAction, configOptions);
    }

    Because the migrated-user modal route has no reportID and no backTo, getAdaptedStateFromPath() falls through to getDefaultFullScreenRoute(), which injects SCREENS.HOME under the modal.

    function getDefaultFullScreenRoute(route?: NavigationPartialRoute) {
    if (route && isRouteWithReportID(route)) {
    const reportID = route.params.reportID;
    // Only allReports should be checked here
    if (!getReportOrDraftReport(reportID, undefined, undefined, {})) {
    return getTabNavigatorState({name: NAVIGATORS.REPORTS_SPLIT_NAVIGATOR});
    }
    const reportsState = getInitialSplitNavigatorState({name: SCREENS.INBOX}, {name: SCREENS.REPORT, params: {reportID}});
    return getTabNavigatorState(reportsState);
    }
    return getTabNavigatorState({name: SCREENS.HOME});
    }

    Then FeatureTrainingModal.closeModal() calls Navigation.goBack() before running the provided onClose callback, so dismissing the modal reveals that Home underlay.

    const closeModal = () => {
    Log.hmmm(`[FeatureTrainingModal] closeModal called - willShowAgain: ${willShowAgain}, shouldGoBack: ${shouldGoBack}, hasOnClose: ${!!onClose}`);
    if (!willShowAgain) {
    Log.hmmm('[FeatureTrainingModal] Dismissing track training modal');
    setNameValuePair(ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING, true, false);
    }
    Log.hmmm('[FeatureTrainingModal] Setting modal invisible');
    setIsModalVisible(false);
    InteractionManager.runAfterInteractions(() => {
    Log.hmmm(`[FeatureTrainingModal] Running after interactions - shouldGoBack: ${shouldGoBack}, hasOnClose: ${!!onClose}`);
    if (shouldGoBack) {
    Log.hmmm('[FeatureTrainingModal] Navigating back');
    Navigation.goBack();
    }
    if (onClose) {
    Log.hmmm('[FeatureTrainingModal] Calling onClose callback');
    onClose();
    } else {
    Log.hmmm('[FeatureTrainingModal] No onClose callback provided');
    }
    });
    };

    The direct missing step is in MigratedUserWelcomeModal.onClose(): it only calls dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL). It does not navigate to the report page after the modal is dismissed.

    const onClose = () => {
    Log.hmmm('[MigratedUserWelcomeModal] onClose called, dismissing product training');
    dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
    };

    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.

    canUseDefaultRooms: boolean | undefined,
    conciergeReportID: string,
    archivedReportsIdSet: ArchivedReportsIDSet,
    onboardingPolicyID?: string,
    onboardingAdminsChatReportID?: string,
    shouldPreventOpenAdminRoom = false,
    ): string | undefined {
    // When hasCompletedGuidedSetupFlow is true, OnboardingModalNavigator in AuthScreen is removed from the navigation stack.
    // On small screens, this removal redirects navigation to HOME. Dismissing the modal doesn't work properly,
    // so we need to specifically navigate to the last accessed report.
    if (!isSmallScreenWidth) {
    if (onboardingAdminsChatReportID && !shouldPreventOpenAdminRoom) {
    return onboardingAdminsChatReportID;
    }
    return undefined;
    }
    const lastAccessedReport = findLastAccessedReport(!canUseDefaultRooms, shouldOpenOnAdminRoom() && !shouldPreventOpenAdminRoom, undefined, archivedReportsIdSet);
    const lastAccessedReportID = lastAccessedReport?.reportID;
    // When the user goes through the onboarding flow, a workspace can be created if the user selects specific options. The user should be taken to the #admins room for that workspace because it is the most natural place for them to start their experience in the app.
    // The user should never go to the self DM or the Concierge chat if a workspace was created during the onboarding flow.
    if (lastAccessedReportID && lastAccessedReport.policyID !== onboardingPolicyID && !isConciergeChatReport(lastAccessedReport, conciergeReportID) && !isSelfDM(lastAccessedReport)) {
    return lastAccessedReportID;
    }
    return undefined;
    }
    function navigateAfterOnboarding(
    isSmallScreenWidth: boolean,
    canUseDefaultRooms: boolean | undefined,
    conciergeReportID: string,
    archivedReportsIdSet: ArchivedReportsIDSet,
    onboardingPolicyID?: string,
    onboardingAdminsChatReportID?: string,
    shouldPreventOpenAdminRoom = false,
    variantOverride?: OnboardingRHPVariant | null,
    ) {
    setDisableDismissOnEscape(false);
    // On mobile (small screen), Track workspace admins with the trackExpensesWithConcierge variant
    // should navigate directly to the Concierge DM (which contains onboarding tasks).
    // This check is outside shouldOpenRHPVariant because that function returns false on native
    // (Side Panel doesn't exist on native), but we still need to navigate to Concierge on mobile.
    const variant = variantOverride ?? onboardingRHPVariant;
    if (isSmallScreenWidth && variant === CONST.ONBOARDING_RHP_VARIANT.TRACK_EXPENSES_WITH_CONCIERGE) {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(conciergeReportID));
    return;
    }
    if (shouldOpenRHPVariant(variantOverride)) {
    handleRHPVariantNavigation(onboardingPolicyID, variantOverride);
    return;
    }
    const reportID = getReportIDAfterOnboarding(
    isSmallScreenWidth,
    canUseDefaultRooms,
    conciergeReportID,
    archivedReportsIdSet,
    onboardingPolicyID,
    onboardingAdminsChatReportID,
    shouldPreventOpenAdminRoom,
    );
    if (reportID) {
    Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID));
    } else {
    // Navigate to home to trigger guard evaluation
    Navigation.navigate(ROUTES.HOME);
    }
    }
    function navigateAfterOnboardingWithMicrotaskQueue(
    isSmallScreenWidth: boolean,
    canUseDefaultRooms: boolean | undefined,
    conciergeReportID: string,
    archivedReportsIdSet: ArchivedReportsIDSet,
    onboardingPolicyID?: string,
    onboardingAdminsChatReportID?: string,
    shouldPreventOpenAdminRoom = false,
    variantOverride?: OnboardingRHPVariant | null,
    ) {
    Navigation.dismissModal();
    Navigation.setNavigationActionToMicrotaskQueue(() => {
    navigateAfterOnboarding(
    isSmallScreenWidth,
    canUseDefaultRooms,
    conciergeReportID,
    archivedReportsIdSet,
    onboardingPolicyID,
    onboardingAdminsChatReportID,
    shouldPreventOpenAdminRoom,
    variantOverride,
    );
    });
    }
    export {navigateAfterOnboarding, navigateAfterOnboardingWithMicrotaskQueue};

    What changes do you think we should make in order to solve the problem?

    Update src/components/MigratedUserWelcomeModal.tsx so dismissing the migrated-user modal reuses the existing post-onboarding navigation helper instead of leaving the user on the Home underlay.

    Implementation:

    1. Import the existing helper and the data it needs:
    import useArchivedReportsIdSet from '@hooks/useArchivedReportsIdSet';
    import useOnyx from '@hooks/useOnyx';
    import usePermissions from '@hooks/usePermissions';
    import {navigateAfterOnboardingWithMicrotaskQueue} from '@libs/navigateAfterOnboarding';
    import ONYXKEYS from '@src/ONYXKEYS';
    1. Read the same inputs used by normal onboarding completion:
    // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
    const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
    const {isBetaEnabled} = usePermissions();
    const archivedReportsIdSet = useArchivedReportsIdSet();
    const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
    1. Add a shared post-dismiss helper:
    const navigateToReportAfterDismiss = () => {
        navigateAfterOnboardingWithMicrotaskQueue(
            isSmallScreenWidth,
            isBetaEnabled(CONST.BETAS.DEFAULT_ROOMS),
            conciergeReportID,
            archivedReportsIdSet,
        );
    };
    1. Call that helper after dismissing the migrated-user training from both exit paths:
    const onHelp = () => {
        Log.info('[MigratedUserWelcomeModal] onHelp called, opening help URL based on admin status and device type');
        const adminUrl = shouldUseNarrowLayout ? CONST.STORYLANE.ADMIN_MIGRATED_MOBILE : CONST.STORYLANE.ADMIN_MIGRATED;
        const employeeUrl = shouldUseNarrowLayout ? CONST.STORYLANE.EMPLOYEE_MIGRATED_MOBILE : CONST.STORYLANE.EMPLOYEE_MIGRATED;
        const helpUrl = isCurrentUserPolicyAdmin ? adminUrl : employeeUrl;
        openExternalLink(helpUrl);
        dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
        navigateToReportAfterDismiss();
    };
    
    const onClose = () => {
        Log.hmmm('[MigratedUserWelcomeModal] onClose called, dismissing product training');
        dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
        navigateToReportAfterDismiss();
    };

    navigateAfterOnboardingWithMicrotaskQueue() already calls Navigation.dismissModal() and queues the report navigation. That is useful here because FeatureTrainingModal.closeModal() has already scheduled Navigation.goBack() before invoking onClose; 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 uses FeatureTrainingModal'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:

    1. Mock navigateAfterOnboardingWithMicrotaskQueue.
    2. Render the component with a Concierge report ID, default-rooms beta value, archived-report set, and small-screen layout.
    3. Press the confirm/"Let's go!" button.
    4. Assert dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL) is called.
    5. Assert navigateAfterOnboardingWithMicrotaskQueue(isSmallScreenWidth, canUseDefaultRooms, conciergeReportID, archivedReportsIdSet) is called.
    6. Cover the reduced-motion branch as well, because it renders a separate FeatureTrainingModal.
    7. Cover the Help button path to ensure it both opens the external help URL and runs the same post-dismiss navigation.

    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() in MigratedUserWelcomeModal.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} to FeatureTrainingModal: Rejected for the same reason. It changes how the modal closes, but the missing behavior is post-dismiss destination selection.

    Use ONYXKEYS.LAST_VISITED_PATH as the modal backTo in MigratedUserWelcomeModalGuard: Plausible but weaker. MIGRATED_USER_WELCOME_MODAL.getRoute(backTo) does support a backTo, but this fix depends on LAST_VISITED_PATH being 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 RootStackRouter or getAdaptedStateFromPath(): 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.

  11. trasnake87 commented on May 7, 2026

    @trasnake87
    Contributor

    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.

    MigratedUserWelcomeModalGuard returns a REDIRECT to ROUTES.MIGRATED_USER_WELCOME_MODAL (src/libs/Navigation/guards/MigratedUserWelcomeModalGuard.ts:86-94). RootStackRouter.handleNavigationGuards consumes the redirect and resets the stack to whatever getAdaptedStateFromPath produces for that route (src/libs/Navigation/AppNavigator/createRootStackNavigator/RootStackRouter.ts:97-110):

    // src/libs/Navigation/AppNavigator/createRootStackNavigator/RootStackRouter.ts:97-110
    if (guardResult.type === 'REDIRECT') {
        const redirectState = getAdaptedStateFromPath(guardResult.route, linkingConfig.config);
        if (!redirectState?.routes) {
            return null;
        }
        const resetAction = CommonActions.reset({
            index: redirectState.index ?? redirectState.routes.length - 1,
            routes: redirectState.routes,
        });
        return stackRouter.getStateForAction(state, resetAction, configOptions);
    }

    Because MIGRATED_USER_WELCOME_MODAL is a basic-modal route with no reportID, the adapted state is [ReportsSplit(HOME)] + [MigratedUserWelcomeModal]. This is the only thing under the modal — no specific report is targeted.

    2 — MigratedUserWelcomeModal.onClose does not navigate after dismissing.

    src/components/MigratedUserWelcomeModal.tsx:58-61 only calls dismissProductTraining:

    // src/components/MigratedUserWelcomeModal.tsx:58-61
    const onClose = () => {
        Log.hmmm('[MigratedUserWelcomeModal] onClose called, dismissing product training');
        dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
    };

    FeatureTrainingModal.closeModal (src/components/FeatureTrainingModal.tsx:340-367) runs Navigation.goBack() and then this onClose, 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 with navigateAfterOnboardingWithMicrotaskQueue which resolves to the user's last-accessed report via findLastAccessedReport (src/libs/navigateAfterOnboarding.ts:27-99, src/libs/ReportUtils.ts:2259-2298):

    // src/libs/navigateAfterOnboarding.ts:85-99
    const reportID = getReportIDAfterOnboarding(
        isSmallScreenWidth,
        canUseDefaultRooms,
        conciergeReportID,
        archivedReportsIdSet,
        onboardingPolicyID,
        onboardingAdminsChatReportID,
        shouldPreventOpenAdminRoom,
    );
    if (reportID) {
        Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID));
    } else {
        Navigation.navigate(ROUTES.HOME);
    }

    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_ROOMS beta, RHP variant, admin-room preference, isSmallScreenWidth mobile-vs-large-screen split) for free.

    Change src/components/MigratedUserWelcomeModal.tsx as follows:

    // src/components/MigratedUserWelcomeModal.tsx
    import React, {useMemo} from 'react';
    import {View} from 'react-native';
    import useArchivedReportsIdSet from '@hooks/useArchivedReportsIdSet';
    import useIsPaidPolicyAdmin from '@hooks/useIsPaidPolicyAdmin';
    import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset';
    import useLocalize from '@hooks/useLocalize';
    import useOnyx from '@hooks/useOnyx';
    import usePermissions from '@hooks/usePermissions';
    import useResponsiveLayout from '@hooks/useResponsiveLayout';
    import useStyleUtils from '@hooks/useStyleUtils';
    import useThemeStyles from '@hooks/useThemeStyles';
    import Accessibility from '@libs/Accessibility';
    import {openExternalLink} from '@libs/actions/Link';
    import {dismissProductTraining} from '@libs/actions/Welcome';
    import convertToLTR from '@libs/convertToLTR';
    import Log from '@libs/Log';
    import {navigateAfterOnboardingWithMicrotaskQueue} from '@libs/navigateAfterOnboarding';
    import variables from '@styles/variables';
    import CONST from '@src/CONST';
    import ONYXKEYS from '@src/ONYXKEYS';
    // ...
    
    function MigratedUserWelcomeModal() {
        const {translate} = useLocalize();
        const styles = useThemeStyles();
        const StyleUtils = useStyleUtils();
        // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
        const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
        const {isBetaEnabled} = usePermissions();
        const archivedReportsIdSet = useArchivedReportsIdSet();
        const [conciergeReportID = ''] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
        // ...rest unchanged
    
        const onHelp = () => {
            // ...existing code unchanged
        };
    
        const onClose = () => {
            Log.hmmm('[MigratedUserWelcomeModal] onClose called, dismissing product training');
            dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
            navigateAfterOnboardingWithMicrotaskQueue(
                isSmallScreenWidth,
                isBetaEnabled(CONST.BETAS.DEFAULT_ROOMS),
                conciergeReportID,
                archivedReportsIdSet,
            );
        };

    Two notes on navigateAfterOnboardingWithMicrotaskQueue:

    • It internally calls Navigation.dismissModal() and then queues navigateAfterOnboarding via Navigation.setNavigationActionToMicrotaskQueue (src/libs/navigateAfterOnboarding.ts:102-125). That is exactly what we want here — the FeatureTrainingModal's Navigation.goBack() already runs first inside InteractionManager.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.
    • We pass no onboardingPolicyID / onboardingAdminsChatReportID because 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 what findLastAccessedReport returns when the admin-room override is omitted.

    The same pattern needs to apply when the user dismisses via the help button — onHelp opens 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:

    // src/components/MigratedUserWelcomeModal.tsx
    const navigateToReports = () => {
        navigateAfterOnboardingWithMicrotaskQueue(
            isSmallScreenWidth,
            isBetaEnabled(CONST.BETAS.DEFAULT_ROOMS),
            conciergeReportID,
            archivedReportsIdSet,
        );
    };
    
    const onHelp = () => {
        Log.info('[MigratedUserWelcomeModal] onHelp called, opening help URL based on admin status and device type');
        const adminUrl = shouldUseNarrowLayout ? CONST.STORYLANE.ADMIN_MIGRATED_MOBILE : CONST.STORYLANE.ADMIN_MIGRATED;
        const employeeUrl = shouldUseNarrowLayout ? CONST.STORYLANE.EMPLOYEE_MIGRATED_MOBILE : CONST.STORYLANE.EMPLOYEE_MIGRATED;
        const helpUrl = isCurrentUserPolicyAdmin ? adminUrl : employeeUrl;
        openExternalLink(helpUrl);
        dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
        navigateToReports();
    };
    
    const onClose = () => {
        Log.hmmm('[MigratedUserWelcomeModal] onClose called, dismissing product training');
        dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
        navigateToReports();
    };

    Why this approach

    Reusing navigateAfterOnboardingWithMicrotaskQueue matches 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 in onClose — would also clear the symptom on Android, but it duplicates the filter logic already centralized in getReportIDAfterOnboarding, drifts the moment that helper learns about a new edge case (RHP variants, archived sets, the TRACK_EXPENSES_WITH_CONCIERGE redirect), 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 RootStackRouter or getAdaptedStateFromPath to 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.

  12. David-2002065 commented on May 7, 2026

    @David-2002065
    Contributor

    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:

    function getMigratedUserWelcomeModalRoute(basePath?: string): Route {
    return createDynamicRoute(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path, basePath ?? (Navigation.getActiveRoute() || ROUTES.HOME));
    }

    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:

    const handleClose = () => {
    const spendRoute = ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT})});
    Navigation.goBack(undefined, {
    afterTransition: () => Navigation.navigate(spendRoute),
    });
    };

    So the destination is only correct if goBack() first reveals the Home underlay and the deferred afterTransition callback then fires Navigation.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 the basePath to the canned Expense Reports search route (the Spend page), which is already a registered entryScreen (SCREENS.SEARCH.ROOT) for this dynamic route:

    function getMigratedUserWelcomeModalRoute(basePath?: string): Route {
        const spendPath = ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT})});
        return createDynamicRoute(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path, basePath ?? spendPath);
    }

    With the underlay now the Spend page, MigratedUserWelcomeModal.handleClose no longer needs the imperative navigate and can simply pop the modal (dismissal is still persisted by the existing useBeforeRemove(persistDismissal)):

    const handleClose = () => {
        Navigation.goBack();
    };

    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)

  13. 20 remaining items

  14. grgia commented on May 27, 2026

    @grgia
    Contributor

    @eVoloshchak picking this up after the auto-assign. What's the status here?

  15. trjExpensify commented on May 28, 2026

    @trjExpensify
    Contributor

    #90134 (comment) - commented in the PR, let's CP a revert ASAP tomorrow please. CC: @jamesdeanexpensify

  16. eVoloshchak commented on May 28, 2026

    @eVoloshchak
    Contributor

    Revert PR is at #91934

  17. melvin-bot commented on Jun 22, 2026

    @melvin-bot

    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!

  18. grgia commented on Aug 12, 2026

    @grgia
    Contributor

    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.

  19. David-2002065 commented on Aug 12, 2026

    @David-2002065
    Contributor

    Some history on this one for @grgia, since you asked whether it still reproduces.

    const handleClose = () => {
    const spendRoute = ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT})});
    Navigation.goBack(undefined, {
    afterTransition: () => Navigation.navigate(spendRoute),
    });
    };

    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:

    function getMigratedUserWelcomeModalRoute(basePath?: string): Route {
    return createDynamicRoute(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path, basePath ?? (Navigation.getActiveRoute() || ROUTES.HOME));
    }

    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.

  20. trjExpensify commented on Aug 12, 2026

    @trjExpensify
    Contributor

    This is working correctly now, so nothing to do here @grgia.

  21. grgia commented on Aug 13, 2026

    @grgia
    Contributor

    Thanks. Alright, closing this out.

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.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions