| author | |
| committer | |
| log | 2ebc9fa4ed24e389eef24039f27c73ae6633858f |
| tree | d6f97e4189584d8b925dc54820d0e5b98c986638 |
| parent | 5eecc24a10013be14e496b485f8d1d9491c75f6a |
| signature | Signed by PGP key B5690EEEBB952194 |
3 files changed, 21 insertions(+), 3 deletions(-)
apps/mobile/src/lib/threadActivity.test.ts+16-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | import { derivePendingRequests } from "@t3tools/client-runtime/pending-requests"; |
| 2 | import { describe, expect, it } from "vite-plus/test"; | |
| 2 | import { beforeEach, describe, expect, it } from "vite-plus/test"; | |
| 3 | 3 | |
| 4 | 4 | import { |
| 5 | 5 | ApprovalRequestId, |
| ... | ... | @@ -27,6 +27,21 @@ import { |
| 27 | 27 | type WorkLogEntry, |
| 28 | 28 | } from "./threadActivity"; |
| 29 | 29 | |
| 30 | // Match Hermes: these ES2023 array methods are absent on mobile. | |
| 31 | beforeEach(() => { | |
| 32 | const methods = ["toSorted", "toReversed"] as const; | |
| 33 | const descriptors = methods.map((method) => | |
| 34 | Object.getOwnPropertyDescriptor(Array.prototype, method), | |
| 35 | ); | |
| 36 | for (const method of methods) Reflect.deleteProperty(Array.prototype, method); | |
| 37 | return () => { | |
| 38 | for (const [index, method] of methods.entries()) { | |
| 39 | const descriptor = descriptors[index]; | |
| 40 | if (descriptor) Reflect.defineProperty(Array.prototype, method, descriptor); | |
| 41 | } | |
| 42 | }; | |
| 43 | }); | |
| 44 | ||
| 30 | 45 | const singleSelectQuestion = { |
| 31 | 46 | id: "runtime", |
| 32 | 47 | header: "Runtime", |
packages/client-runtime/src/work-log/presentation.ts+3-1| ... | ... | @@ -658,7 +658,9 @@ export function omitSupersededLifecycleMarkers<T>( |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | return reversedEntries.toReversed(); | |
| 661 | // Hermes lacks toReversed; this array is local, so reversing it cannot mutate the input. | |
| 662 | // oxlint-disable-next-line unicorn/no-array-reverse | |
| 663 | return reversedEntries.reverse(); | |
| 662 | 664 | } |
| 663 | 665 | |
| 664 | 666 | export function toolGroupSummaryKind( |
packages/client-runtime/src/work-log/userInput.ts+2-1| ... | ... | @@ -27,8 +27,9 @@ function questionFingerprint( |
| 27 | 27 | questions: ReadonlyArray<unknown>, |
| 28 | 28 | ): string | undefined { |
| 29 | 29 | const texts = questions.map((question) => (typeof question === "string" ? question.trim() : "")); |
| 30 | // Sort the fresh array in place because Hermes does not provide toSorted. | |
| 30 | 31 | return texts.length > 0 && texts.every(Boolean) |
| 31 | ? JSON.stringify([turnId, texts.toSorted()]) | |
| 32 | ? JSON.stringify([turnId, texts.sort()]) | |
| 32 | 33 | : undefined; |
| 33 | 34 | } |
| 34 | 35 |