Improve conversation message search responsiveness [WPB-26110] - #21623
Merged
Conversation
MohamadJaara
force-pushed
the
mo/debounce-conversation-message-search
branch
from
June 22, 2026 15:16
7ddf561 to
1a1db66
Compare
MohamadJaara
marked this pull request as ready for review
June 22, 2026 15:16
MohamadJaara
requested review from
arjita-mitra,
e-maad,
otto-the-bot,
screendriver,
thisisamir98 and
zskhan
as code owners
June 22, 2026 15:16
screendriver
force-pushed
the
mo/debounce-conversation-message-search
branch
4 times, most recently
from
June 24, 2026 08:14
b4ff66b to
a980701
Compare
screendriver
previously approved these changes
Jun 24, 2026
screendriver
enabled auto-merge
June 24, 2026 08:17
Extract full-search query lifecycle management into useFullSearch so input state, immediate parent updates, debounced provider execution, stale result handling, and cancellation are explicit and separated from rendering. Thread AbortSignal through the collection search path and check cancellation at conversation search batch boundaries. Extract conversation event matching into a named helper while preserving regex reuse, lastIndex reset, expired ephemeral event filtering, and whitespace-query short-circuiting. Add debounce-fn to @wireapp/webapp and keep use-debounce available for existing callers. Add regression coverage for debounce timing, immediate change notification, clearing results, stale result suppression, latest-query behavior, regex reuse, expired events, whitespace queries, and batch-boundary aborts.
screendriver
force-pushed
the
mo/debounce-conversation-message-search
branch
from
June 24, 2026 08:35
a980701 to
e57b8f0
Compare
screendriver
approved these changes
Jun 24, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Improves in-conversation message search responsiveness in the browser.
The search input now debounces queries, avoids stacking multiple expensive searches while the user is still typing, and keeps the browser responsive while scanning large local conversation histories.
Why It Was Slow
Conversation message search was doing more work than it looked like from the UI:
That means searching a large conversation was not just
Nstring checks. It could become repeated local storage reads, repeated message-text extraction, repeated regex compilation, and repeated main-thread scans.Fixes
Tests
Verification
yarn nx test webapp --testFile=apps/webapp/src/script/page/MainContent/panels/Collection/Collection.test.tsx --runInBandyarn nx test webapp --testFile=apps/webapp/src/script/repositories/conversation/ConversationService.test.ts --runInBandyarn nx run webapp:type-check