From 01b0c64a6347cce84f3a69d018cb512426702af5 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Mon, 1 Jun 2026 01:55:35 -0400 Subject: [PATCH] fix(battle-node): inject resultCode=1 into every scripted synchronize push MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The client's OnReceived routing drops any synchronize push whose resultCode != Success(1) โ€” and absent counts as 0(None), which is also dropped. Our InitNetwork ack and BattleFinish already included resultCode=1, but the five lifecycle bodies (Matched, BattleStart, Deal, Swap response, Ready) didn't, so the client silently dropped every one of them. Symptom: battle-traffic.ndjson capture showed the client receiving InitNetwork/Matched/BattleStart, but the UI stayed at the matchmaking screen until timeout โ€” Matched/BattleStart were dropped at the routing layer before they ever reached the state machine. Move the resultCode injection into the shared EnvelopeForPush helper so every scripted push gets it. Caught during v1 smoke walkthrough. Co-Authored-By: Claude Opus 4.7 --- SVSim.BattleNode/Lifecycle/ScriptedLifecycle.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SVSim.BattleNode/Lifecycle/ScriptedLifecycle.cs b/SVSim.BattleNode/Lifecycle/ScriptedLifecycle.cs index 47ec22c..164a348 100644 --- a/SVSim.BattleNode/Lifecycle/ScriptedLifecycle.cs +++ b/SVSim.BattleNode/Lifecycle/ScriptedLifecycle.cs @@ -149,8 +149,14 @@ public static class ScriptedLifecycle return deck; } - private static MsgEnvelope EnvelopeForPush(NetworkBattleUri uri, Dictionary body, string? bid = null) => - new(uri, + private static MsgEnvelope EnvelopeForPush(NetworkBattleUri uri, Dictionary body, string? bid = null) + { + // Synchronize-push routing in the client's OnReceived drops any frame whose + // resultCode != Success (1). Absent counts as 0 (None) and is also dropped โ€” so we + // MUST include it on every scripted push, not just InitNetwork ack / BattleFinish. + // See server-to-client.md ยง"Routing in OnReceived" and the matching prod captures. + body["resultCode"] = (int)ReceiveNodeResultCode.Success; + return new MsgEnvelope(uri, ViewerId: FakeOpponentViewerId, Uuid: "node-stub", Bid: bid, @@ -159,4 +165,5 @@ public static class ScriptedLifecycle PubSeq: null, PlaySeq: null, // OutboundSequencer.AssignAndArchive stamps this Body: body); + } }