fix(mobile): prevent Android thread search crash - #5386
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Approved 52d39c8 Straightforward bug fix replacing ES2023 You can customize Macroscope's approvability policy. Learn more. |
52d39c8 to
3ed9d0f
Compare
## What's Changed * fix(mcp): unblock Kimi models in OpenCode with preview tools by @hwanseoc in pingdotgg/t3code#5128 * fix(web): clear main branch lint warnings by @t3dotgg in pingdotgg/t3code#5384 * fix(mobile): preserve grouped project workspaces by @shivamhwp in pingdotgg/t3code#4642 * fix(mobile): prevent Android thread search crash by @shivamhwp in pingdotgg/t3code#5386 * fix(web): truncate long project switcher names by @FllipEis in pingdotgg/t3code#5348 * fix(mobile): avoid double dividers between thread sections by @shivamhwp in pingdotgg/t3code#5391 * fix(web): keep the composer command menu anchored to the composer by @StiensWout in pingdotgg/t3code#5336 * fix(web): restore terminal link hover styles by @StiensWout in pingdotgg/t3code#5382 * fix(ci): isolate releases from shared API rate limits by @t3dotgg in pingdotgg/t3code#5394 **Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260805.1002...v0.0.32-nightly.20260805.1005 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1005
(cherry picked from commit 70de6e1)
Fixes #5250.
Android thread search crashes as soon as a query reaches two characters because content search builds its cache key with
Array.prototype.toSorted(), which Hermes does not provide. The resulting render-time exception blanks the home screen.Use a copied mutable sort instead, preserving the stable key and leaving the input array untouched. Add a regression test that removes
toSortedfrom the runtime so this compatibility path stays covered.Android verification
Verification:
vp test run packages/client-runtime/src/state/threadSearch.test.tsvp fmt --check packages/client-runtime/src/state/threadSearch.ts packages/client-runtime/src/state/threadSearch.test.tsvp lint packages/client-runtime/src/state/threadSearch.ts packages/client-runtime/src/state/threadSearch.test.tsvp run typecheckinpackages/client-runtimeGenerated with GPT-5.6-Sol through the Codex harness in T3 Code.
Note
Low Risk
Small, localized change to cache-key construction with an added test; behavior is intended to match the previous stable key format.
Overview
Fixes Android thread search crashing once queries reach two characters, when Hermes throws because
Array.prototype.toSortedis missing.makeThreadSearchKeynow copies environment IDs and uses.sort()on that copy so cache keys stay order-stable without mutating the caller’s array. A regression test stripstoSortedfrom the prototype to lock in Hermes-compatible behavior.Reviewed by Cursor Bugbot for commit 3ed9d0f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
makeThreadSearchKeycrash on Android by replacingtoSortedwithsortThe Hermes JavaScript engine used on Android does not support
Array.prototype.toSorted, causing a crash in thread search. threadSearch.ts is updated to spread-copy the environment IDs array and call.sort()instead, achieving the same deterministic key output without relying on the unavailable method. A Jest test is added that removestoSortedfromArray.prototypeto verify the fallback behavior.Macroscope summarized 3ed9d0f.