The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 19:00 UTC
fix(mobile): prevent Android thread search crash (#5386)
shivam committed
Aug 5, 2026 at 11:30 UTC
70de6e17860d7343a73e117e6e9e1ce41b1b633e
2 files changed
+14
-1
packages/client-runtime/src/state/threadSearch.test.ts
+13
@@ -23,6 +23,19 @@ it("creates stable keys regardless of environment order", () => {
23
);
24
});
25
26
+it("creates keys without array methods unavailable in Hermes", () => {
27
+ const descriptor = Object.getOwnPropertyDescriptor(Array.prototype, "toSorted");
28
+ Reflect.deleteProperty(Array.prototype, "toSorted");
29
+
30
+ try {
31
+ expect(makeThreadSearchKey([envB, envA], "needle")).toBe('[["env-a","env-b"],"needle"]');
32
+ } finally {
33
+ if (descriptor !== undefined) {
34
+ Reflect.defineProperty(Array.prototype, "toSorted", descriptor);
35
+ }
36
+ }
37
+});
38
+
39
it("encodes scoped thread keys without delimiter collisions", () => {
40
const first = threadSearchMatchKey({
41
environmentId: EnvironmentId.make("env\u0000thread"),
packages/client-runtime/src/state/threadSearch.ts
+1
-1
@@ -28,7 +28,7 @@ export function makeThreadSearchKey(
28
query: string,
29
): string {
30
return JSON.stringify([
31
- [...environmentIds].toSorted((left, right) => left.localeCompare(right)),
31
+ [...environmentIds].sort((left, right) => left.localeCompare(right)),
32
query,
33
]);
34
}