You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-07-21] Search - Search router opens and closes when opening search with promo modal opened #93964
Version Number: 9.4.15-1 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:#92007 Email or phone of affected tester (no customers):sdjnoisdjdosijsonssjo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Other
👋 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:
Identify the pull request that introduced this issue and revert it.
On /ai-features-promo the promo modal is both an open Modal and a navigation route. The Search router (CMD+K) is not a navigation route — it's a React‑state overlay (isSearchRouterDisplayed) that integrates with browser history. The two collide on web:
CMD+K → toggleSearch() → openSearchRouter() pushes a history entry window.history.pushState({isSearchModalOpen: true}), then calls Modal.close(cb, false, /* shouldCloseAllModals */ true).
On web, that goBack pops browser history past the {isSearchModalOpen: true} entry → fires a popstate whose state lacks isSearchModalOpen → listener sets isSearchRouterDisplayed = false.
Meanwhile the modal‑close callback opened the router (setIsSearchRouterDisplayed(true)).
Net result: the router opens, then the goBack-triggered popstate immediately closes it. This is web‑only (matches the reported platforms — Windows/MacOS Chrome/Safari), since the history/popstate path is guarded by isBrowserWithHistory/canListenPopState.
Note: the new AIFeaturesPromoGuard is not the cause — it explicitly allows GO_BACK, and opening Search dispatches no navigation action for it to block.
What changes do you think we should make in order to solve the problem?
Defer the search router's history push until after the existing modals finish closing, so the promo modal's goBack can't pop the router's history entry. In openSearchRouter (SearchRouterContext.tsx:98-118), move the window.history.pushState({isSearchModalOpen: true}) call inside the close(...) callback (alongside openSearch(...)), instead of before close(...).
This is a general fix — it makes the router robust to opening on top of any modal route whose dismissal triggers a history-mutating goBack, not just this promo modal.
What alternative solutions did you explore? (Optional)
Suppress CMD+K while the promo modal is up: early-return in SearchHandler when the promo navigator is topmost (like the existing isOnboardingFlow() check). Avoids the flash but blocks a legitimate action.
shouldGoBack={false} on the promo modal: risks breaking the modal's normal route dismissal, since /ai-features-promo relies on goBack to close.
Revert PR #92007: fastest deploy-blocker unblock if a fix can't land quickly, since the conflict is entirely introduced by the new promo modal route.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/93964) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Search - Search router opens and closes when opening search with promo modal opened[/-][+][Due for payment 2026-07-21] Search - Search router opens and closes when opening search with promo modal opened[/+]on Jul 14, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.33-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@mjasikowski 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]
Activity
applause-bot commentedon Jun 18, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/bd0dd7728e3f642ea566f07b19533dbc58436b7139e3a24be05410ca580e1bee
melvin-bot commentedon Jun 18, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #92007
melvin-bot commentedon Jun 18, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 18, 2026
👋 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:
MelvinBot commentedon Jun 18, 2026
Proposal
What is the root cause of that problem?
On
/ai-features-promothe promo modal is both an openModaland a navigation route. The Search router (CMD+K) is not a navigation route — it's a React‑state overlay (isSearchRouterDisplayed) that integrates with browser history. The two collide on web:toggleSearch()→openSearchRouter()pushes a history entrywindow.history.pushState({isSearchModalOpen: true}), then callsModal.close(cb, false, /* shouldCloseAllModals */ true).FeatureTrainingModal'spendingCloseModalAction.shouldGoBackdefaults totrueandAIFeaturesPromoModaldoesn't override it →Navigation.goBack()dismisses the/ai-features-promoroute.goBackpops browser history past the{isSearchModalOpen: true}entry → fires apopstatewhose state lacksisSearchModalOpen→ listener setsisSearchRouterDisplayed = false.setIsSearchRouterDisplayed(true)).Net result: the router opens, then the
goBack-triggeredpopstateimmediately closes it. This is web‑only (matches the reported platforms — Windows/MacOS Chrome/Safari), since the history/popstate path is guarded byisBrowserWithHistory/canListenPopState.Sequence of events
What changes do you think we should make in order to solve the problem?
Defer the search router's history push until after the existing modals finish closing, so the promo modal's
goBackcan't pop the router's history entry. InopenSearchRouter(SearchRouterContext.tsx:98-118), move thewindow.history.pushState({isSearchModalOpen: true})call inside theclose(...)callback (alongsideopenSearch(...)), instead of beforeclose(...).This is a general fix — it makes the router robust to opening on top of any modal route whose dismissal triggers a history-mutating
goBack, not just this promo modal.What alternative solutions did you explore? (Optional)
SearchHandlerwhen the promo navigator is topmost (like the existingisOnboardingFlow()check). Avoids the flash but blocks a legitimate action.shouldGoBack={false}on the promo modal: risks breaking the modal's normal route dismissal, since/ai-features-promorelies ongoBackto close.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/93964)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
IuliiaHerets commentedon Jun 18, 2026
Chrome / v9.4.15-2
Not here page opens
bandicam.2026-06-19.00-30-19-292.mp4
puneetlath commentedon Jun 18, 2026
Seems expected since we modal was reverted.
Fix search router opens/closes when AI promo modal is up
melvin-bot commentedon Jul 10, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
lanitochka17 commentedon Jul 10, 2026
Deploy Blocker #95856 was identified to be related to the PR #94012 that attempted to fix this issue.
melvin-bot commentedon Jul 10, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-]Search - Search router opens and closes when opening search with promo modal opened[/-][+][Due for payment 2026-07-21] Search - Search router opens and closes when opening search with promo modal opened[/+]melvin-bot commentedon Jul 14, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 14, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.33-8 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-21. 🎊
melvin-bot commentedon Jul 14, 2026
@mjasikowski 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]