From 72ed58442e4d0f3633653a3ef9ee0561f3e74fa8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Jul 2026 09:29:39 +0000 Subject: [PATCH 1/3] Initial plan From e16d8a621eacefd68d6b1e68184fadf1f32997f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Jul 2026 09:34:46 +0000 Subject: [PATCH 2/3] test: stabilize instant e2e push backup ordering assertion --- packages/rei-standard-amsg/instant/test/e2e.test.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rei-standard-amsg/instant/test/e2e.test.mjs b/packages/rei-standard-amsg/instant/test/e2e.test.mjs index a018ac7..f724aeb 100644 --- a/packages/rei-standard-amsg/instant/test/e2e.test.mjs +++ b/packages/rei-standard-amsg/instant/test/e2e.test.mjs @@ -165,6 +165,7 @@ describe('e2e: push payload contract parity with amsg-server', () => { for (const call of router.pushCalls) { backups.push(JSON.parse(await decryptCapturedPushBody(call.body, subKit))); } + backups.sort((a, b) => a.messageIndex - b.messageIndex); assert.equal(backups[0].messageId, payloads[0].messageId); assert.equal(backups[1].messageId, payloads[1].messageId); }); From 62fadd182db325bd578c93d07719833c9deeb496 Mon Sep 17 00:00:00 2001 From: Tosd0 <65720409+Tosd0@users.noreply.github.com> Date: Fri, 17 Jul 2026 17:54:02 +0800 Subject: [PATCH 3/3] test: document why instant e2e sorts push backups by messageIndex The bare sort reads as redundant without the reason behind it. Record that SSE backup pushes go out concurrently, so the order they hit the intercepting fetch is unrelated to the SSE order. Claude-Session: https://claude.ai/code/session_011YT96KgPecPVLQnwk2x4Fz --- packages/rei-standard-amsg/instant/test/e2e.test.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/rei-standard-amsg/instant/test/e2e.test.mjs b/packages/rei-standard-amsg/instant/test/e2e.test.mjs index f724aeb..c05722f 100644 --- a/packages/rei-standard-amsg/instant/test/e2e.test.mjs +++ b/packages/rei-standard-amsg/instant/test/e2e.test.mjs @@ -165,6 +165,11 @@ describe('e2e: push payload contract parity with amsg-server', () => { for (const call of router.pushCalls) { backups.push(JSON.parse(await decryptCapturedPushBody(call.body, subKit))); } + // Backup pushes are fired concurrently (`backupWork` in index.js) — + // each races through its own async encryption before calling fetch, + // so interception order is NOT the SSE order. Normalize by + // messageIndex: the contract under test is that a given index + // carries the same messageId on both transports. backups.sort((a, b) => a.messageIndex - b.messageIndex); assert.equal(backups[0].messageId, payloads[0].messageId); assert.equal(backups[1].messageId, payloads[1].messageId);