Skip to content

[Due for payment 2026-07-17] [$250] "Let's go" migrate welcome button redirects to Inbox instead of Spend page after completing the demo #95228

Closed

Description

@m-natarajan

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


Version Number:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @flaviadefaria
Slack conversation (hyperlinked to channel name): #Migrate

Action Performed:

  1. Log in as a Migrated user
  2. Click on the 2-minute demo on the modal
  3. Watch the demo until completion
  4. Navigate back to New Expensify
  5. Click the "Let's go" button
  6. Observe the page the user is redirected to

Expected Result:

After clicking "Let's go", the user should be redirected to the Spend page.

Actual Result:

The user is redirected to the Inbox page instead of the Spend page.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

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

Screenshots/Videos

The links for the FS are in Slack thread

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @parasharrajat

Activity

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

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The "Let's go!" button in the MigratedUserWelcomeModal never navigates to the Spend page — it only pops the modal, revealing whatever screen was underneath (the Inbox).

    The intended navigation to Spend lives only in the handleDismiss handler, which is wired to react-navigation's beforeRemove event via useBeforeRemove. But the confirm button doesn't call it directly — the modal passes onClose={handleClose} (Navigation.goBack()) and no onConfirm prop to FeatureTrainingContent. Since shouldCloseOnConfirm defaults to true, clicking "Let's go!" collapses to just Navigation.goBack().

    The handleDismiss → Navigation.navigate(SEARCH_ROOT) call then fires during the in-flight GO_BACK removal, where it is dropped/overridden by the pop that is completing. The net result is the goBack target (Inbox), not Spend. useBeforeRemove even documents this limitation and recommends replacing it with usePreventRemove after the react-navigation 7.x upgrade.

    Evidence (SHA 351f01d)
    • Modal passes onClose (goBack) but no onConfirm; the SEARCH_ROOT navigation is only inside handleDismiss/useBeforeRemove: MigratedUserWelcomeModal.tsx:54-93
    • handleConfirm runs onConfirm?.() then, because shouldCloseOnConfirm defaults true, calls onClose?.(): FeatureTrainingContent.tsx:168 and :255-260
    • beforeRemove limitation note + listener: useBeforeRemove.tsx:5-13
    • "Spend" = the Search tab = ROUTES.SEARCH_ROOT with a canned query, i.e. the same route handleDismiss targets — so the intended destination is correct, only the navigation is lost: SearchTabButton.tsx:37-108, common.spend: 'Spend' in en.ts

    Data flow: Let's go! → handleConfirm → (no onConfirm) → onClose → Navigation.goBack() pops the modal and emits beforeRemove → handleDismiss fires navigate(SEARCH_ROOT) mid-removal → superseded by the pop → user lands on Inbox.

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

    Make the confirm ("Let's go!") path navigate to the Spend page explicitly instead of relying on goBack + the beforeRemove handler:

    • Pass an onConfirm to FeatureTrainingContent that runs the same logic as handleDismiss (dismissProductTraining(...) + Navigation.navigate(ROUTES.SEARCH_ROOT...)), and set shouldCloseOnConfirm={false} so a subsequent goBack doesn't clobber the navigation.

    Alternatively (and more robustly for all dismissal paths — confirm, backdrop press, swipe), replace handleClose's Navigation.goBack() with a direct Navigation.navigate(ROUTES.SEARCH_ROOT...), so every exit deterministically lands on Spend without depending on beforeRemove timing.

    What alternative solutions did you explore? (Optional)

    Keeping the beforeRemove/goBack approach but reordering the calls is fragile because the navigate is issued during the removal dispatch. Long term, migrating off useBeforeRemove to usePreventRemove (per the hook's own note) would remove this class of timing bug.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/95228) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  3. kitvasyl commented on Jul 2, 2026

    @kitvasyl

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After a migrated user completes the 2-minute demo, clicking “Let's go” in the welcome modal opens Inbox instead of Spend.

    What is the root cause of that problem?

    In src/components/MigratedUserWelcomeModal.tsx, the confirmation handler dismisses the modal and relies on the route underneath it. The demo navigation changes that underlying state, so returning from the demo leaves Inbox as the destination rather than Spend.

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

    Update the welcome modal’s confirmation handler to explicitly navigate to the existing Spend route after dismissing the modal. This makes “Let's go” deterministic regardless of whether the user opened and completed the test-drive flow first. Add a regression test covering confirmation after returning from the demo.

    What alternative solutions did you explore? (Optional)

    We could restore the pre-demo route when leaving the test drive, but that couples the demo flow to this modal. Explicitly routing the modal’s CTA to its intended destination is smaller and more reliable.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 2, 2026
  5. shivang-goliyan commented on Jul 2, 2026

    @shivang-goliyan
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-07-02 19:05:10 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    A migrated user finishes the welcome modal (watches the 2-minute demo or just hits "Let's go") and expects to land on the Spend page. Instead they end up on Inbox. The button that's supposed to drop them into their expenses drops them somewhere else.

    What is the root cause of that problem?

    This is a regression from cba9db2bff1 (2026-06-17), the commit that migrated MigratedUserWelcomeModal to CenteredModalLayout. Before that change the modal was a self-managed FeatureTrainingModal, and its onClose ran dismissProductTraining() and then Navigation.navigate(SEARCH_ROOT) — so closing always resolved to Spend.

    After the migration the modal is a navigator screen, so closing it goes through Navigation.goBack(), which just reveals whatever screen is underneath the overlay — Inbox. The "go to Spend" navigation got moved into useBeforeRemove(handleDismiss) in src/components/MigratedUserWelcomeModal.tsx (lines 54-60). When you confirm, FeatureTrainingContent.handleConfirm runs (shouldCloseOnConfirm defaults to true), which calls onClose → handleClose → goBack(). The Navigation.navigate(SEARCH_ROOT) that handleDismiss dispatches from inside beforeRemove races the pop that's already in flight and loses, so Inbox wins.

    You can see the intended contract in the sibling modals. AutoSubmitModal, ChangePolicyEducationalModal, and HoldOrRejectEducationalModal all use useBeforeRemove for NVP cleanup only and do their real navigation in onConfirm. MigratedUserWelcomeModal is the only one that puts a Navigation.navigate to a different route inside beforeRemove, and that's the bug.

    One thing worth calling out: this isn't only the button. Backdrop press and swipe-to-dismiss regressed the same way. The old onClose sent all of those to Spend; now they all go through goBack() to Inbox with only the NVP cleanup running. The fix should cover the confirm path and the dismiss path together, not just "Let's go".

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

    Split the two concerns so they match the pattern the sibling modals already follow. Keep handleDismiss for cleanup only, and move the navigation into an onConfirm handler with shouldCloseOnConfirm={false} so we don't fire a competing goBack:

    const handleDismiss = () => dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
    useBeforeRemove(handleDismiss);
    const handleConfirm = () => Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT})}));
    // on <FeatureTrainingContent>: onConfirm={handleConfirm} shouldCloseOnConfirm={false}

    Navigating to SEARCH_ROOT tears down the overlay and lands on Spend in one action, which is exactly the pre-regression behavior. The same handleConfirm should back the backdrop/swipe dismiss so those paths land on Spend too.

    One thing to validate in a running web build: MigratedUserWelcomeModalGuard.shouldBlockWhileModalActive() blocks non-DISMISS_MODAL/GO_BACK actions while the modal is active and training hasn't been dismissed yet (Onyx cache is async). In the reported demo path dismissProductTraining has already run via "Try 2-min demo", so the guard won't block the navigate. The no-demo path needs the dismiss to land before the navigate, so I'd confirm ordering on web before finalizing.

    There's no test asserting where confirm/close lands — only MigratedUserWelcomeModalGuard.test.ts exists, and it covers the guard logic. I'd add a test that confirms both the button and the dismiss paths route to Spend so this doesn't silently regress again.

    What alternative solutions did you explore? (Optional)

    Keep the navigation in beforeRemove but chain it after the pop settles (e.g. defer the navigate). That works around the race instead of fixing the ownership problem, and it leaves MigratedUserWelcomeModal as the odd one out versus its siblings. Doing the navigation in onConfirm is cleaner and matches the established pattern. I also checked whether this was the TestDriveDemo navigator or getTestDriveURL, but the code rules both out — getTestDriveURL only picks which video plays, and TestDriveDemo is a separate feature.

  6. ahmdshrif commented on Jul 2, 2026

    @ahmdshrif
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    A migrated user opens the "Welcome to New Expensify!" modal, tries the 2-minute demo, comes back, and clicks "Let's go!". They should land on the expense/Spend Search page, but they land on Inbox instead.

    What is the root cause of that problem?

    PR #93815 (Refactor MigratedUserWelcome modal to CenteredModalLayout, merged 2026-06-22) moved the post-dismiss "navigate to Spend" out of the modal's explicit close handler into a beforeRemove listener. A navigation dispatched from inside beforeRemove runs in the middle of the GO_BACK dispatch that is removing the modal, and never survives it. Chain:

    1. "Let's go!" → handleConfirm calls onClose (
      const handleConfirm = () => {
      onConfirm?.(willShowAgain);
      if (shouldCloseOnConfirm) {
      onClose?.();
      }
      ) → handleClose = () => Navigation.goBack() (
      const handleClose = () => Navigation.goBack();
      ).
    2. The Spend navigation only exists in handleDismiss, registered via useBeforeRemove (
      const handleDismiss = () => {
      Log.hmmm('[MigratedUserWelcomeModal] dismissing product training');
      dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
      Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT})}));
      };
      useBeforeRemove(handleDismiss);
      ). Before #93815, this navigate ran in onClose after the modal was fully closed; now it runs inside the removal event.
    3. react-navigation computes the popped state for GO_BACK before emitting beforeRemove, and commits that state after the listeners return (useOnAction: shouldPreventRemove emission precedes setState(result)). So the Navigation.navigate(SEARCH_ROOT…) dispatched by the listener pushes the Search route, and the outer GO_BACK — whose new state was computed from the pre-navigate state — immediately overwrites it. Last write wins; the Search push is silently discarded. (The repo already flags this hook as limited:
      // beforeRemove have some limitations. When the react-navigation is upgraded to 7.x, update this to use usePreventRemove hook.
      .)
    4. On the non-demo path there is a second, independent kill: guards run first on every root action (
      getStateForAction(state: StackNavigationState<ParamListBase>, action: RootStackNavigatorAction, configOptions: RouterConfigOptions) {
      // Evaluate navigation guards FIRST
      const guardState = handleNavigationGuards(state, action, configOptions, stackRouter);
      if (guardState) {
      return guardState;
      }
      ), and shouldBlockWhileModalActive blocks any non-GO_BACK/DISMISS action while the modal navigator is still state.routes.at(-1) and the dismissal NVP hasn't landed (
      function shouldBlockWhileModalActive(state: NavigationState, action: NavigationAction): boolean {
      const isAllowedAction = action.type === CONST.NAVIGATION.ACTION_TYPE.DISMISS_MODAL || action.type === CONST.NAVIGATION.ACTION_TYPE.GO_BACK;
      return (
      hasRedirectedToMigratedUserModal &&
      !isProductTrainingElementDismissed('migratedUserWelcomeModal', dismissedProductTraining) &&
      state.routes.at(-1)?.name === NAVIGATORS.MIGRATED_USER_MODAL_NAVIGATOR &&
      !isAllowedAction
      );
      }
      ). dismissProductTraining is an async optimistic Onyx merge (
      function dismissProductTraining(elementName: string, isDismissedUsingCloseButton = false) {
      const date = new Date();
      const dismissedMethod = isDismissedUsingCloseButton ? 'x' : 'click';
      const optimisticData = [
      {
      onyxMethod: Onyx.METHOD.MERGE,
      key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
      value: {
      [elementName]: {
      timestamp: DateUtils.getDBTime(date.valueOf()),
      dismissedMethod,
      },
      },
      },
      ];
      API.write(WRITE_COMMANDS.DISMISS_PRODUCT_TRAINING, {name: elementName, dismissedMethod}, {optimisticData});
      }
      ), so it can't have propagated one line later. In the demo flow, onHelp already dismissed the NVP (
      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);
      };
      ), which resets the guard's flag (
      Onyx.connectWithoutView({
      key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
      callback: (value) => {
      dismissedProductTraining = value;
      isDismissedProductTrainingLoaded = true;
      if (isProductTrainingElementDismissed('migratedUserWelcomeModal', value)) {
      hasRedirectedToMigratedUserModal = false;
      }
      navigateToMigratedUserWelcomeModalIfReady();
      },
      });
      ) — the guard allows the navigate, but the commit-ordering clobber in step 3 still discards it.
    5. The GO_BACK therefore lands on whatever sits under the modal: the base path captured when the guard pushed it — Navigation.getActiveRoute() || ROUTES.HOME, i.e. Inbox for a freshly migrated user (
      function getMigratedUserWelcomeModalRoute(basePath?: string): Route {
      return createDynamicRoute(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path, basePath ?? (Navigation.getActiveRoute() || ROUTES.HOME));
      }
      ).

    Structural cause: a navigation side effect was attached to the removal event of the screen being removed, so it always races the removal that triggers it. Both dismissal paths (with and without the demo) are affected; the FullStory session captured the demo one.

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

    In MigratedUserWelcomeModal.tsx, keep beforeRemove only as the dismissal backstop and dispatch the Spend navigation after the pop commits, using the existing afterTransition option of Navigation.goBack (

    if (options?.afterTransition) {
    TransitionTracker.runAfterTransitions({callback: options.afterTransition, waitForUpcomingTransition: true});
    }
    ):

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

    This covers both close entry points with one change: the confirm button (FeatureTrainingContent L255-L259) and backdrop press (

    <CenteredModalLayout
    onBackdropPress={handleClose}
    contentStyle={[styles.pt0, styles.pb0]}
    ) both call handleClose. By afterTransition time the modal is no longer top-of-stack, so neither the guard block nor the state clobber applies, on either NVP timing. Regression safety: onHelp, the guard, and dismissal semantics are unchanged — the only behavior change is that the navigate is dispatched after the pop instead of during it. (Destination stays the canned expense-report Search route the current code targets; if product wants the literal Spend tab, it's a one-word query change at the same site.)

    Why the obvious spot fix fails: calling Navigation.navigate(...) synchronously right after Navigation.goBack() (or leaving it inside handleDismiss) still loses — the GO_BACK's popped state is computed before the listener/next line runs and committed after, overwriting the Search push; and whenever the async dismissal NVP hasn't propagated, shouldBlockWhileModalActive swallows the NAVIGATE outright while the modal navigator is still on top.

    What alternative solutions did you explore? (Optional)

    1. Restore the pre-#93815 shape (navigate directly in onClose, no goBack) — the old FeatureTrainingModal closed itself via its hide-animation callback; with route-backed CenteredModalLayout the modal route must be popped explicitly, and navigating without popping leaves the modal route stacked under Search.
    2. Relax shouldBlockWhileModalActive to allow NAVIGATE during dismissal — touches shared guard logic, risks reintroducing the tab-switch race the guard exists to prevent, and doesn't fix the setState clobber (the demo path proves blocking isn't the only defeat).
    3. Navigate only from onConfirm — misses the backdrop-press dismissal, which also runs handleClose and would still land on Inbox.
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 2, 2026
  8. oqildev commented on Jul 2, 2026

    @oqildev
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  9. aswin-s commented on Jul 2, 2026

    @aswin-s
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    On Web (Chrome, Safari/macOS), after a migrated user watches the 2-minute demo and clicks the "Let's go" button in MigratedUserWelcomeModal, they land on the Inbox page instead of the Spend (Search/Reports) page. Clicking "Let's go" should navigate to the Spend page.

    What is the root cause of that problem?

    In src/components/MigratedUserWelcomeModal.tsx (lines 81–99), MigratedUserWelcomeModal renders FeatureTrainingContent without passing an onConfirm prop — only onClose={handleClose} is wired, where handleClose = () => Navigation.goBack() (line 63).

    In src/components/FeatureTrainingContent.tsx (lines 253–258), handleConfirm is:

    const handleConfirm = () => {
        onConfirm?.(willShowAgain);  // no-op — no onConfirm passed
        if (shouldCloseOnConfirm) {  // true by default
            onClose?.();              // calls Navigation.goBack() → Inbox
        }
    };

    So pressing "Let's go" unconditionally calls Navigation.goBack(), which pops the modal and reveals Inbox.

    The useBeforeRemove(handleDismiss) at line 60 registers a beforeRemove listener that calls Navigation.navigate(ROUTES.SEARCH_ROOT…). However, handleDismiss never calls e.preventDefault() on the navigation event, so the original goBack() still proceeds. On web, the goBack() wins this race and the subsequent navigate(SEARCH_ROOT) is effectively discarded — the user sees Inbox.

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

    All changes are in src/components/MigratedUserWelcomeModal.tsx:

    1. Add an explicit handleConfirm callback (around line 54, alongside the existing handleDismiss):

      const handleConfirm = () => {
          dismissProductTraining(CONST.MIGRATED_USER_WELCOME_MODAL);
          Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query: buildCannedSearchQuery({type: CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT})}));
      };

      This mirrors what handleDismiss already does. Navigation.navigate(SEARCH_ROOT) navigates the root navigator to the Spend page, which inherently closes the modal — no separate goBack() is needed.

    2. Pass onConfirm and shouldCloseOnConfirm={false} to <FeatureTrainingContent> (around line 86–99):

      <FeatureTrainingContent
          {...illustrationProps}
          ...
          onConfirm={handleConfirm}
          shouldCloseOnConfirm={false}   {/* prevent goBack() firing after onConfirm */}
          onClose={handleClose}
          ...
      >

      shouldCloseOnConfirm={false} is critical: without it, FeatureTrainingContent.handleConfirm calls both onConfirm (which navigates to SEARCH_ROOT) and then onClose (which calls Navigation.goBack()), risking popping the user off the just-navigated Spend page or double-firing handleDismiss via beforeRemove.

    3. Keep useBeforeRemove(handleDismiss) unchanged for the backdrop-press / hardware-back dismissal path — when the user closes the modal without pressing "Let's go", this hook still navigates them to the Spend page.

    What alternative solutions did you explore? (Optional)

    • Rely solely on useBeforeRemove(handleDismiss): The existing handleDismiss already calls navigate(SEARCH_ROOT) in beforeRemove. The problem is that without e.preventDefault(), the goBack event proceeds alongside the navigate call. On web, the goBack() wins the race, so this mechanism is unreliable for the "Let's go" button path.
    • Call e.preventDefault() in handleDismiss: Would intercept ALL removal events (including back-button / backdrop), causing the modal to be un-closeable unless you manually navigate. Worse, useBeforeRemove exposes the raw event listener and handleDismiss doesn't currently receive the event object — requires refactoring the hook.
    • Passing shouldCloseOnConfirm={false} alone (without onConfirm): Does nothing on its own — onConfirm is still a no-op, user still ends up on Inbox via the residual goBack() on the close path.
  10. abbasifaizan70 commented on Jul 2, 2026

    @abbasifaizan70
    Contributor

    Note: This is not a duplicate — it closes a path every prior proposal (including the anchor-based ones) leaves broken. The proposals so far fall into two families. Family A re-dispatches a navigation at close time (onConfirm + shouldCloseOnConfirm={false}, direct navigate() in handleClose, goBack + afterTransition, goBack(backToRoute)). Family B re-anchors the modal over Spend in MigratedUserWelcomeModalGuard so a plain goBack() lands on Spend. What no proposal in either family accounts for is that the guard is not the only place the modal's anchor is built: on web, a refresh while the modal is open goes through NavigationRoot.tsx, which rebuilds the modal over lastVisitedPath — the Inbox. Every proposal that (correctly) removes the racy navigate from beforeRemove therefore reintroduces this exact bug after a mid-modal refresh: the anchor reverts to Inbox and backdrop/goBack exits land there again. Search the thread — lastVisitedPath and NavigationRoot appear in no other proposal. This proposal fixes both anchor sites, which is the difference between reducing the bug and eliminating it.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    A migrated user opens the welcome modal, watches the 2-minute demo, returns, and clicks "Let's go!" — they land on Inbox instead of the Spend page. Backdrop dismissal has the same defect.

    What is the root cause of that problem?

    The modal is a dynamic route stacked over a base path, and closing it reveals that base. The intended "go to Spend" lives only in a beforeRemove listener, where the Navigation.navigate(SEARCH_ROOT…) is dispatched mid-GO_BACK and clobbered by the pop that is committing (and on the no-demo path can additionally be swallowed by shouldBlockWhileModalActive, since NAVIGATE is not an allowed action while the modal navigator is top-of-stack).

    The anchor is built in two places, and both point at the wrong screen:

    1. MigratedUserWelcomeModalGuard.ts L31–33 — anchors over Navigation.getActiveRoute() || ROUTES.HOME (Inbox for a fresh migrated user) when the guard redirects or proactively navigates.

    2. NavigationRoot.tsx L131–134 — on web refresh with the modal URL, rebuilds the modal over lastVisitedPath:

    if (path?.includes(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path) && shouldOpenLastVisitedPath(lastVisitedPath) && ...) {
        Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path, lastVisitedPath));

    Fixing only site 1 (or only the close handlers) leaves site 2 restoring an Inbox-anchored modal, so the bug survives any refresh while the modal is open.

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

    Anchor the modal over Spend at both sites, and reduce beforeRemove to the NVP side-effect only — no navigation is ever dispatched during a removal.

    1. MigratedUserWelcomeModalGuard.ts — build the route over the canned expense-report Search route (export a small helper, e.g. getMigratedUserWelcomeBasePath(), so both sites share it):
    function getMigratedUserWelcomeModalRoute(): Route {
        return createDynamicRoute(DYNAMIC_ROUTES.MIGRATED_USER_WELCOME.path, getMigratedUserWelcomeBasePath());
    }

    This is config-supported: SCREENS.SEARCH.ROOT is already in MIGRATED_USER_WELCOME.entryScreens (ROUTES.ts L143–145).

    1. NavigationRoot.tsx L131–134 — use the same Spend base path instead of lastVisitedPath when restoring the modal on refresh, so the restored modal is anchored identically to a freshly pushed one.

    2. MigratedUserWelcomeModal.tsx — handleDismiss keeps only dismissProductTraining(...); handleClose stays a bare Navigation.goBack(). This matches the sibling-modal contract the codebase already follows (AutoSubmitModal uses useBeforeRemove for NVP persistence only).

    Coverage: "Let's go!", backdrop press, hardware back, swipe, and Escape all terminate in GO_BACK — the one action type the guard always allows — over a Spend anchor; the demo and no-demo NVP timings are irrelevant because no NAVIGATE is ever dispatched; and a mid-modal web refresh restores the modal over Spend, so post-refresh exits land correctly too. The browser URL while the modal is open reflects Spend + suffix, so the state is deep-linkable and refresh-safe by construction.

    Tests: extend MigratedUserWelcomeModalGuard.test.ts to assert redirect/proactive routes are anchored on SEARCH_ROOT; add a linking test asserting the refresh-restore path anchors on SEARCH_ROOT rather than lastVisitedPath; add a component test asserting beforeRemove performs only the NVP dismissal.

    What alternative solutions did you explore? (Optional)

    Close-handler fixes (onConfirm + shouldCloseOnConfirm={false}, direct navigate(), afterTransition, goBack(backToRoute)) all keep or work around a dispatch racing the pop, and each leaves at least one exit or the guard's NVP-timing window uncovered; none of them, nor a guard-only anchor change, addresses the NavigationRoot refresh restore, which re-anchors the modal over Inbox and brings the bug back. Keeping lastVisitedPath as the refresh anchor "to preserve context" was rejected as moot: the modal's only product-intended exit is Spend, and the current code already force-navigates there from every dismissal path.

  11. melvin-bot commented on Jul 2, 2026

    @melvin-bot

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

  12. changed the title [-]Full Story: "Let's go" button redirects to Inbox instead of Spend page after completing the demo[/-] [+][$250] Full Story: "Let's go" button redirects to Inbox instead of Spend page after completing the demo[/+] on Jul 2, 2026
  13. 47 remaining items

  14. changed the title [-][$250] "Let's go" migrate welcome button redirects to Inbox instead of Spend page after completing the demo[/-] [+][Due for payment 2026-07-17] [$250] "Let's go" migrate welcome button redirects to Inbox instead of Spend page after completing the demo[/+] on Jul 10, 2026
  15. melvin-bot commented on Jul 10, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Jul 10, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.32-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-07-17. 🎊

    For reference, here are some details about the assignees on this issue:

    • @jmusial does not require payment (Contractor)
    • @parasharrajat requires payment through NewDot Manual Requests
  17. melvin-bot commented on Jul 10, 2026

    @melvin-bot

    @parasharrajat The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  18. melvin-bot commented on Jul 13, 2026

    @melvin-bot

    @parasharrajat Whoops! This issue is 2 days overdue. Let's get this updated quick!

  19. parasharrajat commented on Jul 14, 2026

    @parasharrajat
    Member

    We can close this. All done here.

  20. Beamanator commented on Jul 14, 2026

    @Beamanator
    Contributor

    no payment due here @parasharrajat ?

  21. parasharrajat commented on Jul 15, 2026

    @parasharrajat
    Member

    yes. Its a follow-up.

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions