Repository navigation
Enter asks Discord itself, and the network's hits join the list. - #58
Merged
Merged
Conversation
This was referenced Oct 20, 2026
itz4blitz
requested changes
Oct 20, 2026
itz4blitz
left a comment
Owner
There was a problem hiding this comment.
Asking the network on Enter is the right shape, and the merge by conversation + message id, the 202 handling and the stale-answer count all look good. Two things need fixing before this can go near a real account, plus some smaller ones.
Must fix
- Wrong search parameter.
adapters/discord/info.rs:341,345,346sendquery=, but Discord's message search takes the words ascontent=(max 1024 characters). As written the words aren't applied, so the pane most likely shows the server's or channel's newest messages under "Searched Discord · …". The fake (tests/discord.rs:268) and the asserts (:2757,:2765) lockquery=in too, so please switch them all tocontent=. - Nothing limits network searches.
enter_search/ask_network(gui/conversation/side.rs:598-660) send a newSearchNetworkon every Enter. That includes Enter again for the same words and scope, Enter while one is still in flight, and key auto-repeat while Enter is held. chatd forwards every one (server.rs:1427). Discord limits search tightly, and those 429s count towardrefused()and the account pause. Please:- in the GUI, don't ask again for the same words and scope while one is in flight or once it has answered, and ignore held-key repeats;
- in chatd, bound it per account as people search already does (
SEARCH_GAP/SEARCH_AGAINindiscord/members.rs:527-548), so no client can turn Enter into a burst.
Should fix
- The Space id goes into the URL unchecked.
info.rs:341puts the client's Space id into/guilds/{space}/….space_infochecksstate.guilds.contains_key(guild)first (info.rs:205); do the same here. The conversation path is already gated byknown. - Search runs on the adapter's command thread (
discord.rs:987). A slow search, or a 429 wait, holds sends, edits and reactions behind it, and a search still queued after the server's 30 s answer timeout still goes to Discord. At the least, skip the call when the reply's receiver is already gone. - Enter in Everywhere now does nothing. Everywhere is the switcher's and Shift-Command-F's default, and
Scope::Everywhere => returnapplies when nothing is picked; in #55 Enter opened the first hit. Once a row is picked there's also no keyboard way back to asking the network. - Wording:
side.rs:667shows chatd's raw detail. An older chatd yields "chatd does not understand this request… (unknown variantsearch_network…)", which names chatd and a Rust value. Map errors to plain words.side.rs:1096says "The network found nothing here." even when the network refused, answered 202, or failed.
- How network hits join the list:
- they aren't filtered for hidden conversations or message requests, which the cache already excludes;
- they're appended after every cache hit regardless of date;
- their snippet is the whole message cut to one line, so the match may not be visible (the cache's snippet is windowed around the match).
NetworkFound.target(:85) is never read, which adds a newdead_codewarning.- The README still says the networks are not asked. After this it should say Enter asks Discord, for a server or a conversation.
Tests
The fake keys on query=. Its 202 uses code: 0 (Discord's is 110000, though any code is detected). Nothing covers a guild-channel conversation scope, an adapter answering Unsupported, the stale-answer guard, or Enter semantics; a test that repeated Enter sends one request would pin the limit down.
unRekable
force-pushed
the
feat/search-network-layer
branch
from
October 20, 2026 15:22
426cf52 to
d019000
Compare
unRekable
force-pushed
the
feat/search-hit-rows
branch
from
October 20, 2026 15:22
c146e3f to
7fb3442
Compare
itz4blitz
force-pushed
the
feat/search-hit-rows
branch
from
October 24, 2026 16:55
7fb3442 to
6730d04
Compare
itz4blitz
force-pushed
the
feat/search-network-layer
branch
from
October 24, 2026 17:10
44c19a2 to
bde3dc3
Compare
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.
Stacked on #57 (which is stacked on #55) — merge those first. Against
feat/search-hit-rowsso only this slice shows.What
The search pane's second layer, per
docs/product/05-navigation.md§5: Enter asks the network itself, and its hits join the list./guilds/{id}/messages/search), a conversation's scope the channel's (/channels/{id}/messages/searchfor DMs). Everywhere still reads the cache alone — its networks (Slack whole-account, Telegram) come with a later slice, and a Discord server is only searched when it is the scope, as the spec has it.cachedtag, the network's speak for themselves. A line says what was searched ("Searched Discord · Moss & Lichen.") — or why nothing came, as with a server whose index is still building ("Discord search isn't ready for this server yet", Discord's 202).Pieces
Request::SearchNetworkin the protocol (optional keys as always, so an older frame still reads), served by routing to the account's adapter as a newCommand::Search— the same reply-channel pattern asDownloadandHandoff. Networks that cannot search answerUnsupported, which the pane shows as words.search_messagesbeside the provensearch_shared: the same endpoints, the same 202-indexing detection, hits mapped from the server's answer.query=) with its own hits and a 202 case; the new integration test covers Space scope, DM channel scope, and the 202 words in one pass. The shared-files search test rides the old branch unchanged.Tests
cargo test --workspace-relevant suites green locally on Windows x64:chatd --test discord31/31 (incl. the new test),protocol24/24 (incl. the wire test),cargo test -p tinyclient --features gui351/351 (incl. the merge test).Known gaps