Repository navigation
fix(client-runtime): prevent oversized thread search crashes - #136
Merged
Merged
Conversation
Thread content search threw during render when a cache key was malformed or the query exceeded the 200-character contract. Refs #133 Co-authored-by: Gannon Hall <gannonh@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
This was referenced Aug 26, 2026
gannonh
marked this pull request as ready for review
August 26, 2026 19:01
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.
Closes #133
What Changed
Thread content search decoded its JSON cache key with
JSON.parseplusSchema.decodeUnknownSync. A query over the 200-character contract, or a malformed key, threw during React render in web and mobile.ThreadSearchKeyis nowSchema.fromJsonStringaround the existing tuple. Decode usesSchema.decodeUnknownOption. Invalid keys return{ matches: [], isLoading: false }and do not callgetSearchAtom. Valid merge, failure ignore, and local title search are unchanged.Why
The command palette and mobile thread search subscribe to this shared atom. The hook only enforces the 2-character minimum, so a 201-character query still reached the atom and aborted the client.
Scope
packages/client-runtime/src/state/threadSearch.tspackages/client-runtime/src/state/threadSearch.test.tsOut of scope: server limit, truncation, new copy, ranking, snippets, web/mobile hook files, T3 identity.
Blast Radius
Web command palette and mobile thread search both use
createThreadSearchResultsAtomFamily. They get empty content matches for an invalid query and keep title search. No contract, server, or layout change.Verification
vp test run packages/client-runtime/src/state/threadSearch.test.ts(6 passed)vp run --filter @kata-sh/code-client-runtime typecheck(exit 0; pre-existingdiscovery.tssuggestion only)@t3tools/,T3CODE_,t3code,pingdotgg/t3code: clean104addbe: Check, Test, Mobile Native Static Analysis, Release Smoke greensettrestored Open settings; reopen restored the root list with no reloadCommand palette with a 201-character query still open
Palette after shortening the query to sett, Open settings selected
Live mobile thread-search pass is blocked on this VM (no emulator). Mobile uses the same atom covered by the tests.
Acceptance matrix: #133 (comment)
Build report: #133 (comment)
Checklist
Parent: #124. Upstream: pingdotgg/t3code#6633 at
421088c27.To show artifacts inline, enable in settings.