Repository navigation
fix(id/tags): parse_search_query separates terms on general whitespace (#1609) - #1743
Conversation
#1609) Term separation used only the ASCII space byte, so tab/newline/CRLF/NBSP between terms fused them into one unmatchable term and search silently returned empty. Scan by char with char::is_whitespace semantics (char-boundary safe for multi-byte NBSP), keeping whitespace inside quotes as part of the term. Parser tests cover tab/LF/CRLF/NBSP separators, the name:<tab>priority case, and quoted-whitespace preservation.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Fixes #1609 (per triage task 1709, verdict CONFIRMED; implementation queue task 1850).
parse_search_queryinpkgs/id/src/tags.rstreated only the ASCII space byte as a term separator, so a query separated by tab, newline, CRLF or NBSP fused into a single term (e.g.name:foo\tbar:baz→ oneKeyValue(name, "foo\tbar:baz")) that matches no stored tag, andsearch_by_queryANDs to a silently empty result. Reachable with raw user text viaGET /api/tags/search?q=andMetaRequest::SearchTags.Change (parser-local, one file):
charwithchar::is_whitespacesemantics instead of comparing bytes tob' '. The byte index only advances by whole chars, so it always rests on a char boundary — multi-byte whitespace such as NBSP (U+00A0) slices safely.Literal).search_by_queryexecution semantics or CLI/REPL query construction.Tests (new parser unit tests in
tags.rs):SearchTermlist as the space form.name:\tpriorityparses asKeyOnly(name)+BareWord(priority), matching the space form.Literal.parse_search_querytests unchanged.Verification: CI on this PR (cargo test for the id crate + fmt/lint per repo workflows).
Need help on this PR? Tag
@codesmith-botwith what you need.