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
[$250] Investigate SearchAutocompleteList causing 2x slowdown during message sending #91846
When a user navigates to a chat via Search (instead of Inbox), SearchAutocompleteList renders in the background and reacts to message sending. Together with useFilteredOptions, it takes most of the render time and makes ManualSendMessage ~2x slower.
We agreed here that this can wait until @LukasMod is back. You can still take over, @rinej, just saying in case you have higher priority issues on your plate.
Problem:
When navigating to a chat via Search, SearchAutocompleteList stays mounted in background and re-renders on every message send because useFilteredOptions subscribes to COLLECTION.REPORT — which updates on every send. This causes ~2x slowdown in ManualSendMessage.
Root Cause:
useFilteredOptions subscribes to COLLECTION.REPORT, PERSONAL_DETAILS_LIST, COLLECTION.POLICY. Message send triggers COLLECTION.REPORT update → full options list recomputes in background.
Solution — Lazy mount (Option 3):
Only mount SearchAutocompleteList when search input is focused:
[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: N/A. This is a performance improvement
Link to the comment on the Issue: N/A
[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: N/A
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jun 1, 2026
@LukasMod Huh... This is 4 days overdue. Who can take care of this?
VickyStash commentedon Jun 2, 2026
Not overdue!
@LukasMod is OOO this week, someone from callstack will take it over as soon as they have capacity.
rinej commentedon Jun 2, 2026
I'm wrapping up some other tasks, I can help with that
cristipaval commentedon Jun 2, 2026
We agreed here that this can wait until @LukasMod is back. You can still take over, @rinej, just saying in case you have higher priority issues on your plate.
cristipaval commentedon Jun 5, 2026
Not overdue, we'll continue on this one on Monday
rinej commentedon Jun 8, 2026
I've got some ideas how to prevent the double rendering. Going to benchmark and test it.
Draft PR - #92938
26 remaining items
wanrenjiro06 commentedon Jun 15, 2026
Proposal
Problem:
When navigating to a chat via Search, SearchAutocompleteList stays mounted in background and re-renders on every message send because useFilteredOptions subscribes to COLLECTION.REPORT — which updates on every send. This causes ~2x slowdown in ManualSendMessage.
Root Cause:
useFilteredOptions subscribes to COLLECTION.REPORT, PERSONAL_DETAILS_LIST, COLLECTION.POLICY. Message send triggers COLLECTION.REPORT update → full options list recomputes in background.
Solution — Lazy mount (Option 3):
Only mount SearchAutocompleteList when search input is focused:
const [isSearchFocused, setIsSearchFocused] = useState(false);
{isSearchFocused && (
<SearchAutocompleteList
autocompleteQueryValue={queryValue}
// ...other props
/>
)}
<TextInput
onFocus={() => setIsSearchFocused(true)}
onBlur={() => setIsSearchFocused(false)}
/>
Why lazy mount over other options:
Files to modify:
Testing:
Expensify Email: wanrenjiro06@gmail.com
Upwork Profile: https://www.upwork.com/freelancers/~0105d5114cf3ae419f?mp_source=share
rinej commentedon Jun 16, 2026
@cristipaval do we need those proposals?
cristipaval commentedon Jun 17, 2026
@rinej, no, ignore them. I added the
Externallabel to have a C+ auto-assigned.melvin-bot commentedon Jun 23, 2026
@rinej Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Jun 25, 2026
@rinej Eep! 4 days overdue now. Issues have feelings too...
nyomanjyotisa commentedon Jun 26, 2026
BugZero 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: N/A. This is a performance improvement
Link to the comment on the Issue: N/A
[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: N/A
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/653184
Regression Test Proposal
Precondition:
Test:
a) the top navigation back button
b) the swipe-back gesture or device back button
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-6693-aaea-3462-63da1ce7d3c4nyomanjyotisa commentedon Jun 26, 2026
The automation failed here. This should've been due for payment on June 26 @cristipaval
rinej commentedon Jun 26, 2026
The PR with the fix was merged couple of days ago -> #92938
melvin-bot commentedon Jun 27, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Jun 28, 2026
Payment Summary
Contributor+: @nyomanjyotisa due $250 via NewDot
^ Test case created. Thx
trjExpensify commentedon Jul 6, 2026
approved $250 for @nyomanjyotisa