Repository navigation
Search cached messages, on the socket and as tinyclient --text --search. - #12
Merged
Merged
Conversation
unRekable
marked this pull request as ready for review
October 17, 2026 13:56
unRekable
force-pushed
the
search/cached-messages
branch
from
October 17, 2026 14:38
d123677 to
4433107
Compare
itz4blitz
approved these changes
Oct 17, 2026
itz4blitz
left a comment
Owner
There was a problem hiding this comment.
Cached message search matches the protocol and store rules from review: bound LIKE with escaping, requests/hidden/pending excluded, and the README keeps the Signal Note to Self paragraph. macOS, Linux, and Windows CI are green on 4433107.
This was referenced Oct 17, 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.
What changed and why
The roadmap's message search starts here: the cache is searched, over the socket and from the
text shell. A query returns the newest hits, each with where it is and enough of it to choose
by. A later change puts the same hits in the switcher and lands on the message; after that the
networks themselves are asked (the spec's N12, staged).
Request::SearchMessages(filters optional),Response::MessageHitsandMessageHit,added by the protocol's optional-field rules, so an older frame still reads.
Store::search_messages: LIKE over the message text, joined to the conversation for itstitle, newest first, clamped to
PAGE_LIMIT.tinyclient --text --search <query>: the hits as lines, so the change is usable without thewindow.
Decisions taken in the change, with their reasons
went. The product keeps requests out of everything that counts and promises "opening one
reads nothing"; a search that surfaced one would get around that. One SQL condition, tested.
conversation. A cursor can come later as an optional field, which costs nothing then.
retention holds): 8 to 16 ms per search in a release build, holding the store's lock. It
grows with the cache, so an honest ceiling exists. FTS5 would raise the schema version and
with it delete every user's cache, and would add index bookkeeping to ingest, deletes, prune
and forget. When a real, large cache shows the need, that change can stand on its own.
Test
excluded, case-insensitive,
%/_/\mean themselves, and the snippet window with its...markers.tinyclient --text --search lichenreturns the two hits with titles and snippets.
Numbers
40,000 messages, release build, the store's lock held while searching: 15.5 ms (4,000 hits),
10.4 ms (common word), 7.9 ms (full scan, no hits). Grows with the cache; the fix, when a real
cache needs it, is FTS5 as its own change.
Tested on Windows with
--no-default-features(noprotochere for thesignalfeature);cargo check -p tinyclient --features guipasses. The chatd suites that fail on this machine(discord's spawn of
true, the mediad process lookups in e2e, the release-json test intinyclient) fail the same on clean main; the blobs picker test is flaky under parallel load
and passes alone.