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-04-07] [Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats #86454
Version Number: 9.3.49-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85629 Email or phone of affected tester (no customers):snodijosdnjoijiosnj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Search
Action Performed:
Go to staging.new.expensify.com
Create a new Gmail account.
Create a workspace.
Go to workspace chat.
Send a message.
Delete the message (optional).
Go to Reports > Chats.
Expected Result:
App will not crash.
Actual Result:
App crashes after sending message and opening Reports > Chats.
👋 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.
Classification: Frontend bug Causing PR: #85629 - "Defer API.write during Search screen transition to reduce perceived latency" by @JakubKorytko (High confidence) Related Issues: None
Recommendation: REVERT
The PR made significant changes to SearchContext navigation state extraction that are causing crashes when navigating to the Search page (Reports > Chats). A revert is the safest option to unblock the deploy while a proper fix is developed.
Labels: No changes needed - DeployBlockerCash is correctly applied (Frontend bug blocking App deploy)
The most likely root cause is in SearchContext.tsx where the refactoring changed from a single navigation state extraction to multiple useNavigationState hooks:
Each selector calls getDeepestFocusedScreen(state) independently, which could cause render issues or infinite loops when navigation state changes rapidly during the message send → Reports navigation flow.
Root Cause
The refactoring introduced a timing issue where multiple navigation state subscriptions combined with the new deferred write mechanism causes a crash when navigating to the Search screen. The removal of the DeferredSearch wrapper component may have also eliminated important initialization logic that prevented this race condition.
Please re-state the problem that we are trying to solve in this issue.
The app crashes with TypeError: Cannot read properties of undefined (reading 'isLoading') when a user sends a message in a workspace chat and then navigates to Reports > Chats. This is reproducible on staging but not production, indicating it was introduced by a recent merge.
What is the root cause of that problem?
The crash originates from src/components/Search/index.tsx line 460, which was introduced/modified by PR #85629 ("Defer API.write during Search screen transition to reduce perceived latency").
The problematic line uses incomplete optional chaining:
searchResults?.search.isLoading
The ?. only guards against searchResults being null/undefined. When searchResults is defined but searchResults.search is undefined, it evaluates undefined.isLoading, which throws the TypeError.
This crash is now reachable because PR #85629 made two key changes:
Removed the DeferredSearch wrapper component that previously delayed mounting the Search component until search data was ready.
Changed the loading/defer logic so Search can now mount while searchResults is in a partially-populated state (e.g., Onyx has data set via a merge but search not yet populated).
For context, line 466 in the same file correctly uses searchResults?.search?.isLoading with full optional chaining — the inconsistency on line 460 is the bug.
The attached logs confirm the exact error and location:
TypeError: Cannot read properties of undefined (reading 'isLoading')
at Search_Search (authScreens.prefetch-...bundle.js:1:3100763)
What changes do you think we should make in order to solve the problem?
Change line 460 in src/components/Search/index.tsx from:
This adds the missing ?. so that when searchResults.search is undefined, the expression short-circuits to undefined (falsy) instead of throwing.
What alternative solutions did you explore? (Optional)
An alternative would be to revert PR #85629 entirely. However, since the root cause is a simple missing optional chaining operator (and the rest of the file already uses ?.search?. correctly on line 466), the targeted one-character fix is safer and preserves the performance improvements from the PR.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Reports - App crashes after sending message and opening Reports > Chats[/-][+][Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats[/+]on Mar 27, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.49-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@luacmartins@JakubKorytko 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]
changed the title [-][Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats[/-][+][Due for payment 2026-04-07] [Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats[/+]on Mar 31, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.50-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@luacmartins@mallenexpensify@JakubKorytko 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]
Activity
melvin-bot commentedon Mar 26, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85629
melvin-bot commentedon Mar 26, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 26, 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:
OSBotify commentedon Mar 26, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #85629 - "Defer API.write during Search screen transition to reduce perceived latency" by @JakubKorytko (High confidence)
Related Issues: None
Recommendation: REVERT
The PR made significant changes to SearchContext navigation state extraction that are causing crashes when navigating to the Search page (Reports > Chats). A revert is the safest option to unblock the deploy while a proper fix is developed.
Labels: No changes needed -
DeployBlockerCashis correctly applied (Frontend bug blocking App deploy)Detailed Analysis
Evidence
API.writeduring Search screen transition to reduce perceived latency #85629 is deployed) but NOT on productionAPI.writeduring Search screen transition to reduce perceived latency #85629Verification
PR #85629 modified critical Search components:
src/components/Search/SearchContext.tsx- Refactored navigation state extractionsrc/components/Search/index.tsx- Changed skeleton/loading logicsrc/libs/deferredLayoutWrite.ts- New deferred write mechanismsrc/components/Search/DeferredSearch/wrapper componentsThe most likely root cause is in SearchContext.tsx where the refactoring changed from a single navigation state extraction to multiple
useNavigationStatehooks:Before:
After:
Each selector calls
getDeepestFocusedScreen(state)independently, which could cause render issues or infinite loops when navigation state changes rapidly during the message send → Reports navigation flow.Root Cause
The refactoring introduced a timing issue where multiple navigation state subscriptions combined with the new deferred write mechanism causes a crash when navigating to the Search screen. The removal of the DeferredSearch wrapper component may have also eliminated important initialization logic that prevented this race condition.
MelvinBot commentedon Mar 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The app crashes with
TypeError: Cannot read properties of undefined (reading 'isLoading')when a user sends a message in a workspace chat and then navigates to Reports > Chats. This is reproducible on staging but not production, indicating it was introduced by a recent merge.What is the root cause of that problem?
The crash originates from
src/components/Search/index.tsxline 460, which was introduced/modified by PR #85629 ("DeferAPI.writeduring Search screen transition to reduce perceived latency").The problematic line uses incomplete optional chaining:
The
?.only guards againstsearchResultsbeing null/undefined. WhensearchResultsis defined butsearchResults.searchisundefined, it evaluatesundefined.isLoading, which throws the TypeError.This crash is now reachable because PR #85629 made two key changes:
DeferredSearchwrapper component that previously delayed mounting theSearchcomponent until search data was ready.searchResultsis in a partially-populated state (e.g., Onyx hasdataset via a merge butsearchnot yet populated).For context, line 466 in the same file correctly uses
searchResults?.search?.isLoadingwith full optional chaining — the inconsistency on line 460 is the bug.The attached logs confirm the exact error and location:
What changes do you think we should make in order to solve the problem?
Change line 460 in
src/components/Search/index.tsxfrom:to:
This adds the missing
?.so that whensearchResults.searchisundefined, the expression short-circuits toundefined(falsy) instead of throwing.What alternative solutions did you explore? (Optional)
An alternative would be to revert PR #85629 entirely. However, since the root cause is a simple missing optional chaining operator (and the rest of the file already uses
?.search?.correctly on line 466), the targeted one-character fix is safer and preserves the performance improvements from the PR.Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot to refine this analysis, or explain why you are rejecting Melvin's proposal.
JakubKorytko commentedon Mar 26, 2026
Taking a look 👀
JakubKorytko commentedon Mar 26, 2026
Fix ready: #86462
IuliiaHerets commentedon Mar 26, 2026
Issue is not reproduced anymore, build 9.3.49-2
1774551558895.chat.mp4
5 remaining items
[-]Reports - App crashes after sending message and opening Reports > Chats[/-][+][Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats[/+]melvin-bot commentedon Mar 27, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 27, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.49-2 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-04-03. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 27, 2026
@luacmartins @JakubKorytko 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]
melvin-bot commentedon Mar 27, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)[-][Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats[/-][+][Due for payment 2026-04-07] [Due for payment 2026-04-03] Reports - App crashes after sending message and opening Reports > Chats[/+]melvin-bot commentedon Mar 31, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.50-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-04-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 31, 2026
@luacmartins @mallenexpensify @JakubKorytko 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]