From 529fcd92a0180684581497b144062611a280ecaf Mon Sep 17 00:00:00 2001 From: Libby Date: Wed, 11 Nov 2026 16:01:12 +0000 Subject: [PATCH] cultnet-ts test: the reconnecting client sends only after its own handshake completes The server accepting the reconnect is not the client hearing the Accept; sending in that window throws 'before the session is connected' (forge run 1331). Co-Authored-By: Claude Sonnet 5.5 --- packages/cultnet-ts/test/rudp-server.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/cultnet-ts/test/rudp-server.test.ts b/packages/cultnet-ts/test/rudp-server.test.ts index 6ba976d3..0f913055 100644 --- a/packages/cultnet-ts/test/rudp-server.test.ts +++ b/packages/cultnet-ts/test/rudp-server.test.ts @@ -115,6 +115,8 @@ test("a client reconnecting from the same endpoint replaces only its own session assert.throws(() => server.send(oldPeer, "schema", enc("stale")), /not connected/); assert.equal(server.peers.length, 2); + // The server accepting is not the client hearing it: send only once the client's new session is connected. + await waitFor(() => a.connection.connected, "the reconnecting client's handshake"); a.connection.send("schema", enc("after")); b.connection.send("schema", enc("still")); await waitFor(() => a.received.includes("re:after") && b.received.includes("re:still"), "replies after the reconnect");