From 97405518398c2736222ec1187f7e8e8968ace58a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 29 Sep 2026 19:45:38 +0200 Subject: [PATCH] cultnet-ts: pin the operation service handler rejection path as a counted drop The fragment-id-0 test is caught by the session-refusal branch, so a frame that fails inside the handler needs its own test. Co-Authored-By: Claude Opus 5.5 --- packages/cultnet-ts/test/cultnet.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/cultnet-ts/test/cultnet.test.ts b/packages/cultnet-ts/test/cultnet.test.ts index b9aaa2a5..9761b37f 100644 --- a/packages/cultnet-ts/test/cultnet.test.ts +++ b/packages/cultnet-ts/test/cultnet.test.ts @@ -2028,6 +2028,17 @@ test("operation service drops and counts a packet its session refuses and keeps await waitFor(() => server.packetsDropped === 1, "the poisoned frame dropped"); await waitFor(() => received.some((p) => p.packetType === "disconnect"), "the session ended"); + // A frame the session accepts but the service cannot handle rejects inside + // the handler; that too is a dropped packet, not a dead process. + const garbage = new CultNetRudpSession({ connectionId }); + received.length = 0; + toServer(garbage.createConnect(0)); + await waitFor(() => received.some((p) => p.packetType === "accept"), "the second Accept"); + garbage.receive(received[0]!, 0); + const [notMessagePack] = garbage.sendMany("schema", Buffer.from([0xc1]), { reliable: true, ordered: true, nowMs: 0 }); + toServer(notMessagePack!); + await waitFor(() => server.packetsDropped === 2, "the unhandled frame dropped"); + const response = await invokeCultNetOperation(server.endpoint, { schemaVersion: "cultnet.operation_request.v0", messageId: "after-poison",