From a2e0748ab5f3ab6ea44d9213c72517fbccf460c4 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 14:29:30 +0200 Subject: [PATCH] cultmesh-ts: the second at-bound put fits the inbound limit Its ten-character message id made its own frame one byte over maxPayloadBytes, so the inbound cap refused it before admission was asked. The id is now as short as the first put's. Co-Authored-By: Claude Opus 5.5 --- packages/cultmesh-ts/test/cultmesh.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cultmesh-ts/test/cultmesh.test.ts b/packages/cultmesh-ts/test/cultmesh.test.ts index 5d79dacc..5aa0cdf7 100644 --- a/packages/cultmesh-ts/test/cultmesh.test.ts +++ b/packages/cultmesh-ts/test/cultmesh.test.ts @@ -3411,6 +3411,8 @@ test("CultMesh TS RUDP document server honours maxPayloadBytes for replies, puts const limit = 4_000; const atBound = bodyLengthForReplyBytes("note:at", limit); const overBound = bodyLengthForReplyBytes("note:ov", limit + 1); + // A put's own frame is only a few bytes under its reply, so a long message id would push an + // at-bound put over the inbound limit before admission is asked. Keep these ids short. await withServedBoundRig(0x10203062, { maxFragmentBytes: 1024, maxPayloadBytes: limit }, async (rig) => { rig.peer.send(notePut("put-over", "note:ov", overBound)); const refusal = await waitForError(rig, "the over-bound put"); @@ -3436,7 +3438,7 @@ test("CultMesh TS RUDP document server honours maxPayloadBytes for replies, puts assert.deepEqual(rig.admitted, ["note:at"]); // Two servable documents make a reply over the limit: it is not sent, and onError hears why. - rig.peer.send(notePut("put-second", "note:a2", atBound)); + rig.peer.send(notePut("put-a2", "note:a2", atBound)); await waitForAdmission(rig, "note:a2"); rig.peer.sendSnapshotRequest({ schemaVersion: "cultnet.snapshot_request.v0", messageId: "0", recordKeys: ["note:at", "note:a2"] }); const replyStartedAt = Date.now();