Skip to content

[Due for payment 2026-09-15] Domains - Destination domain does not open from search router when on another domain page #100112

Closed

Description

@applause-bot

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


Version Number: 9.4.66-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #98753
Email or phone of affected tester (no customers): applausetester+khcategory19@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Be a domain admin of two domains.
  1. Go to staging.new.expensify.com
  2. Open search router.
  3. Type go to domain members.
  4. Click Go to Domain members on one of the domains.
  5. Open search router via CMD+K.
  6. Type go to saml.
  7. Click Go to SAML on different domain.

Expected Result:

SAML page of another domain will open.

Actual Result:

SAML page of the previous domain opens.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7248558_1788311409060.5.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7248558

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 2, 2026
  2. applause-bot commented on Sep 2, 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/d6e8e9e8c90925cc14f51e453fc3846b4061cd51f6b84e8ad84f0402e634ae22

  3. melvin-bot commented on Sep 2, 2026

    @melvin-bot

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

  4. melvin-bot commented on Sep 2, 2026

    @melvin-bot

    @trjExpensify @carlosmiceli @marufsharifi you have been assigned to this deploy blocker because you reviewed the offending PR: #98753

  5. github-actions commented on Sep 2, 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. melvin-bot commented on Sep 2, 2026

    @melvin-bot

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

  7. MelvinBot commented on Sep 2, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #98753 - "92752 search router domain navigation" by @nabi-ebrahimi (High confidence that it introduced the regression; Medium confidence on the exact navigator mechanism below)
    Related Issues: None found

    Recommendation: REVERT

    The PR is self-contained (2 source files + 1 test file), it is the most recent change to both source files, and the whole "Go to " suggestion set it added is brand new, so nothing depends on it — reverting removes the broken entry point without side effects. A roll-forward is only preferable if the team wants to keep the feature today and can land the cross-domain navigation fix described below (plus a regression test) quickly.

    Assigned: @nabi-ebrahimi (PR author), @trjExpensify, @carlosmiceli, @marufsharifi (approving reviewers) from the causing PR only
    Labels: No changes. DeployBlockerCash stays (App-side fix, App deploy is blocked). DeployBlocker was never applied, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • PR 92752 search router domain navigation #98753 is the PR that added per-domain "Go to Domain members / Domain admins / Groups / SAML" entries to the Search Router: buildDomainNavigationItems and its wiring at useNavigationSuggestions.tsx#L267-L283. Before this PR the reported repro was impossible — there was no way to jump straight from one domain's page into another domain's page; you always had to go through the Domains list.
    • Timeline matches: merged 2026-09-01 12:02 UTC, first shipped in 9.4.66-0 (deploy checklist Deploy Checklist: New Expensify 2026-09-02 #100087), reported the same day. Not reproducible in production because the feature isn't there yet.
    • The suggestion items themselves are built correctly — each item carries its own domain's route (ROUTES.DOMAIN_MEMBERS/ADMINS/GROUPS/SAML.getRoute(domain.accountID) in getDomainMenuItems.ts#L52-L81) and domain.accountID is the same identifier the Domains list uses (DomainsListPage.tsx#L86-L96). So the emitted route is domain/<other-domain>/saml — the breakage happens when that route is applied to the navigation state.

    Verification

    Files involved in the affected flow, all confirmed by reading them at 2aeff10:

    git log/gh api confirm #98753 is the latest change to both source files on main, so a revert applies cleanly.

    Root Cause

    Navigation.navigate('domain/<B>/saml') while a domain page is already open resolves inside the currently mounted domain split navigator, which belongs to domain A:

    1. getMinimalAction walks down the action while the payload name equals the focused route name at each level — TAB_NAVIGATOR → WORKSPACE_NAVIGATOR → DOMAIN_SPLIT_NAVIGATOR. Params are never compared, so domainAccountID: A vs B is invisible to it and the dispatched action ends up target-ed at domain A's split navigator key.
    2. Nothing distinguishes two instances of the split navigator: DOMAIN_SPLIT_NAVIGATOR is registered without a getId (WorkspaceNavigator.tsx#L51-L55), and React Navigation's StackRouter matches NAVIGATE by route name only, so the existing domain-A instance is reused rather than a new domain-B one being pushed.
    3. Consequently the domain-scoped state of that navigator stays on the previous domain: the sidebar route Domain_Initial keeps domainAccountID: A, the preserved split state is domain A's, and SplitRouter.adaptStateIfNecessary continues to seed sidebar/central routes from the existing domain-A params (SplitRouter.ts#L60-L93). The result the tester sees is the requested page rendered in the previous domain's context.

    This is a pre-existing limitation of the split navigators (workspaces have the same shape, but you can only switch workspaces from the Workspaces list, which is outside the split navigator, so a fresh split is always pushed there). PR #98753 is the first entry point that jumps from inside one domain straight into another, which is why it surfaced now, and why the fix belongs in App.

    If rolling forward instead of reverting, the domain suggestions need to force a new split-navigator instance when the target domainAccountID differs from the one currently open (e.g. dismiss to ROUTES.DOMAINS_LIST / push a fresh DOMAIN_SPLIT_NAVIGATOR before navigating), or the navigator needs a getId keyed on domainAccountID so React Navigation stops reusing the previous domain's instance. Either way, please add a navigation test that starts on domain/<A>/members and asserts the state after navigating to domain/<B>/saml — the existing tests in tests/unit/SearchRouterNavigationTest.ts only assert the built route strings, so they can't catch this.

    Note: this analysis is static (the repro requires two admin domains and a running client). The causing PR is unambiguous; the exact React Navigation step at which the domain identity is dropped is my best reading of the navigator code and should be confirmed by whoever picks up the fix.


    view run

  8. nabi-ebrahimi commented on Sep 2, 2026

    @nabi-ebrahimi
    Contributor

    @marufsharifi @carlosmiceli I missed this case because my test account has only one Domain, and I could not add a second Domain to test navigation from Domain A to Domain B. The existing single-Domain flows worked correctly, while this issue only occurs in the cross-Domain scenario.

    If the team can provide access to a test account with two Domains, I can validate the complete flow and prepare a focused follow-up PR for this edge case.

  9. carlosmiceli commented on Sep 2, 2026

    @carlosmiceli
    Contributor

    @trjExpensify I think we can demote this one, but maybe you think it's a bigger issue on prod than what it seems to me.

  10. 17 remaining items

  11. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    @marufsharifi

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.73-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-09-15. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]

  12. melvin-bot commented on Sep 11, 2026

    @melvin-bot

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

  13. marufsharifi commented on Sep 14, 2026

    @marufsharifi
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR:
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    • The account is an administrator for at least two domains.

    Test:

    1. Open Domain A and select Domain members.
    2. Open Search Router using CMD/CTRL + K.
    3. Search for SAML.
    4. Select the SAML result associated with Domain B.
    5. Verify that the Domain B SAML page opens.
    6. Verify that both the Domain sidebar and page title display Domain B.
    7. Repeat the same flow from Domain B back to Domain A.
    8. Verify that the selected page, Domain sidebar, and page title all correspond to the destination Domain.

    Do we agree 👍 or 👎

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Sep 14, 2026
  15. melvin-bot commented on Sep 14, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Sep 14, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. mallenexpensify commented on Sep 16, 2026

    @mallenexpensify
    Contributor

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

    No payment due to @marufsharifi or @nabi-ebrahimi as they worked on the offending issue.

    I missed this case because my test account has only one Domain, and I could not add a second Domain to test navigation from Domain A to Domain B. The existing single-Domain flows worked correctly, while this issue only occurs in the cross-Domain scenario.

    If the team can provide access to a test account with two Domains, I can validate the complete flow and prepare a focused follow-up PR for this edge case.

    Also.. fwiw.. this seems like an edge case that I don't think should lower the price of the parent issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething 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