Skip to content

Copy Settings - User land on Select Workspace modal when navigate back from Select Settings #93879

Closed

Description

@applause-bot

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.4.10-1
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #93546
Email or phone of affected tester (no customers): applausetester+gm1038424@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 10/Chrome
App Component: Other

Action Performed:

  1. Navigate to "Workspaces"
  2. Click on the three dots icon on any workspace → "Copy Settings"
  3. Select any workspace and click "Next"
  4. Select some features and click "Next" to reach the Confirm page
  5. On Let’s make sure everything looks right modal select Settings
  6. Navigate Back from Select settings modal

Expected Result:

User should land on Let’s make sure everything looks right. modal

Actual Result:

User land on Select Workspace modal

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7183913_1781726186165.Recording__924.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Nathan Lemma
Bug ID: 7183913

Issue OwnerCurrent Issue Owner: @shubham1206agra

Activity

  1. applause-bot commented on Jun 17, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/655a8139ffe46b4c47fc1c28153b1d8c60d81028293bd14c2ed4e67758820772

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 17, 2026
  3. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #93546

  4. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jun 17, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on Jun 17, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    This is a regression from PR #93546, which changed the Select Features page's back button from a plain Navigation.goBack() to one with a hardcoded "back to" route — the Select Workspaces page (CopyPolicySettingsSelectFeaturesPage.tsx:301):

    onBackButtonPress={() => Navigation.goBack(sourcePolicyID ? ROUTES.POLICY_COPY_SETTINGS.getRoute(sourcePolicyID) : undefined)}
    

    The argument to Navigation.goBack(backToRoute) is not a "fallback used only when you can't go back" — it actively navigates up to that specific route. Internally it calls goUp, which dispatches a POP_TO/pop(distanceToPop) to that route, popping every screen in between (Navigation.ts:511, Navigation.ts:476-501).

    So in the repro, the navigation stack is Select Workspaces → Select Features → Confirm. On the Confirm page the Settings row navigates to Select Features (CopyPolicySettingsConfirmPage.tsx:77-82). Pressing Back there now force-pops all the way to Select Workspaces instead of returning to the Confirm modal. This is why it reproduces on staging (has the PR) but not production (still uses plain goBack).

    The PR added the hardcoded route to fix back-navigation after a browser refresh (where the RHP stack is rebuilt with only the current screen, so a plain goBack does nothing). But unconditionally forcing the target breaks the case where the user reaches Select Features from the Confirm page.

    Why it works in production but not staging

    In production the Select Features back button was a plain Navigation.goBack(), which pops a single screen and returns to Confirm. The PR replaced it with goBack(ROUTES.POLICY_COPY_SETTINGS…), which always pops up to Select Workspaces regardless of how the page was reached.

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

    The Select Features back button should only fall back to the Select Workspaces route when there is no screen to pop back to (the page-refresh scenario the PR was fixing). When the stack can go back, it should do a normal Navigation.goBack() so it returns to whatever screen the user came from (the Confirm modal in this flow, or Select Workspaces in the normal forward flow).

    Concretely: in onBackButtonPress on CopyPolicySettingsSelectFeaturesPage.tsx:301, gate the hardcoded route behind a "can't go back" check (e.g. navigationRef.current?.canGoBack()), passing the POLICY_COPY_SETTINGS route only when the stack has no previous screen.

    The Confirm page's back button (CopyPolicySettingsConfirmPage.tsx:103) has the same pattern, but its target (Select Features) is the immediate previous screen in the normal flow, so it's harmless today — worth applying the same conditional fallback for consistency.

    What alternative solutions did you explore? (Optional)

    Reverting PR #93546 would fix this regression but reintroduce the original after-refresh navigation bugs (#91792, #92385) that PR was solving, so a targeted conditional-fallback fix is preferable.


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

  7. shubham1206agra commented on Jun 18, 2026

    @shubham1206agra
    Contributor

    @yuwenmemon This is intentional. Please close this issue

  8. fedirjh commented on Jun 18, 2026

    @fedirjh
    Contributor

    @yuwenmemon I think this can be demoted. Seems intentional per #91792 (comment)

  9. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jun 18, 2026
  10. puneetlath commented on Jun 18, 2026

    @puneetlath
    Contributor

    Demoting per the linked convo as it seems this is intentional. I'll let @yuwenmemon make the ultimate call on whether this is a bug or we can close.

  11. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    @shubham1206agra Huh... This is 4 days overdue. Who can take care of this?

  12. melvin-bot commented on Jun 25, 2026

    @melvin-bot

    @shubham1206agra 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  13. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    @shubham1206agra 10 days overdue. I'm getting more depressed than Marvin.

  14. melvin-bot commented on Jul 1, 2026

    @melvin-bot

    @yuwenmemon @fedirjh @shubham1206agra this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  15. melvin-bot commented on Jul 1, 2026

    @melvin-bot

    @shubham1206agra 12 days overdue. Walking. Toward. The. Light...

  16. shubham1206agra commented on Jul 2, 2026

    @shubham1206agra
    Contributor

    @yuwenmemon Can you please close this issue?

  17. yuwenmemon commented on Jul 2, 2026

    @yuwenmemon
    Contributor

    For sure.

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions