From 7edf2c2bc911749bfd2c137d4f772b4510dfdd08 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 15 Sep 2026 18:24:19 -0400 Subject: [PATCH] test(mobile): order each effect against the sends with a send count Sender and effects are two independent lists, so a send reordered ahead of a device write moved neither. Scheduling the codex journal write on a timer instead of awaiting it left all 520 goldens byte-identical; with `sent` it moves two. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- mobile/src/test-support/rpc-recording/run-recording.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mobile/src/test-support/rpc-recording/run-recording.ts b/mobile/src/test-support/rpc-recording/run-recording.ts index 9ace2a7a7c0..0c2022012fb 100644 --- a/mobile/src/test-support/rpc-recording/run-recording.ts +++ b/mobile/src/test-support/rpc-recording/run-recording.ts @@ -22,11 +22,14 @@ export async function runRecording( ): Promise { scheduler.start() const transport = new ScriptedRpcTransport(scheduler.elapsed) - const effects: { name: string; value: RecordedValue }[] = [] + const effects: { name: string; value: RecordedValue; sent: number }[] = [] const settlements: Record = {} const recording: Recording = { scenario: scenario.id, checkpoints: [] } const effect = (name: string, value: unknown) => { - effects.push({ name, value: captureValue(value) }) + // Why the send count: sender and effects are two independent lists, so a send reordered ahead of + // a device write moves neither of them. Stamping the count at push time orders them against + // each other, and that reordering becomes a golden diff. + effects.push({ name, value: captureValue(value), sent: transport.requests.length }) } const stopUnhandled = recordUnhandledRejections(effect) let mounted: MountedOperation | undefined