Description
Typing into the Inbox search (SearchRouter) freezes the JS thread on mobile. The native back gesture and native scrolling still work, but all JS-driven interactions (navigation buttons, virtualization recalculation) become unresponsive.
Steps to Reproduce
- Open the app on a mobile device (iOS or Android)
- Tap the search icon in the Inbox
- Start typing a search query
- Observe that the UI becomes unresponsive
Expected Behavior
Search input should remain responsive while filtering results, with no perceptible lag or JS thread blocking.
Actual Behavior
The JS thread freezes. Navigation buttons stop working, virtualization bounds don't recalculate. Only native gestures (back swipe, scroll) continue to work.
Root Cause
autocompleteQueryValue in SearchRouter.tsx updates immediately on every keystroke (only textInputValue is debounced). This triggers synchronous re-computation of:
getSearchOptions() -- filters all reports/personal details
isSearchStringMatch() -- creates RegExp per word per item
combineOrderingOfReportsAndPersonalDetails() -- sorts results
- Multiple
.filter() chains on tags, categories, currencies, participants
Suggested Fixes
- Debounce
autocompleteQueryValue (or the prop passed to SearchAutocompleteList) so filtering doesn't run on every keystroke
- Memoize
searchOptions and recentReportsOptions with stable dependencies
- Optimize
isSearchStringMatch -- reuse compiled RegExp objects instead of creating new ones per iteration
- Consider moving heavy filtering off the JS thread (InteractionManager, web worker, or native module)
Platform
Reporter
Chuck (Slack thread)
Issue Owner
Current Issue Owner: @abbasifaizan70
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022025920563596911295
- Upwork Job ID: 2025920563596911295
- Last Price Increase: 2026-03-02
- Automatic offers:
- aimane-chnaif | Reviewer | 110717229
Description
Typing into the Inbox search (SearchRouter) freezes the JS thread on mobile. The native back gesture and native scrolling still work, but all JS-driven interactions (navigation buttons, virtualization recalculation) become unresponsive.
Steps to Reproduce
Expected Behavior
Search input should remain responsive while filtering results, with no perceptible lag or JS thread blocking.
Actual Behavior
The JS thread freezes. Navigation buttons stop working, virtualization bounds don't recalculate. Only native gestures (back swipe, scroll) continue to work.
Root Cause
autocompleteQueryValueinSearchRouter.tsxupdates immediately on every keystroke (onlytextInputValueis debounced). This triggers synchronous re-computation of:getSearchOptions()-- filters all reports/personal detailsisSearchStringMatch()-- creates RegExp per word per itemcombineOrderingOfReportsAndPersonalDetails()-- sorts results.filter()chains on tags, categories, currencies, participantsSuggested Fixes
autocompleteQueryValue(or the prop passed toSearchAutocompleteList) so filtering doesn't run on every keystrokesearchOptionsandrecentReportsOptionswith stable dependenciesisSearchStringMatch-- reuse compiled RegExp objects instead of creating new ones per iterationPlatform
Reporter
Chuck (Slack thread)
Issue Owner
Current Issue Owner: @abbasifaizan70Upwork Automation - Do Not Edit