Fix crash when creating a room while the rooms search has no results#96619
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-07-21.at.5.15.51.PM.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.4.42-0 🚀
|
|
🤖 I reviewed the changes in this PR to determine whether any help site articles under No help site changes are required. This PR is a targeted bug fix for a crash that occurred when creating a room while the "Find room" search returned no results (
There is no user-facing behavior change, no new feature, no UI/label/copy change, and no new setting — the app simply no longer crashes and behaves as users already expect. None of that is documented in the help site, so no article edits are needed and no draft docs PR was created. If you believe a specific help article should nonetheless be revised, let me know which one and I'll take another look. |
Explanation of Change
When the rooms search has no results,
TableBodydoesn't mount the FlashList, so the Table ref's fallback to FlashList methods returnsundefined— creating a room then crashed ontableRef.current?.scrollToItem(...)(TypeError: scrollToItem is not a function), and the error boundary showed the "not found" page.The highlight effect now looks the new room up in the table's processed data (
getProcessedData()) instead of the rawroomsprop: if the room is filtered out by the search there's nothing to scroll to, and if it's visible the row instance comes from the data the list actually renders, so FlashList's reference-basedscrollToItemmatches it (previously it silently no-oped because middlewares copy row objects).Fixed Issues
$ #96616
PROPOSAL:
Tests
zzzzz) so the "No results found" state showsOffline tests
Same as Tests (room creation is optimistic, the flow behaves the same offline).
QA Steps
Same as Tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
MacOS: Chrome / Safari
Screen.Recording.2026-07-21.at.12.45.15.mov