Cap a report at 32 KB on both sides of the upload

The client would send up to 256 KB and the sink answered a settling 400 above
64 KB, so the two disagreed about what a valid report is, and the client
deletes what it is told is invalid. Unreachable in practice — the module table
and backtrace are both bounded, which puts the ceiling near 10 KB — but the
two constants have to agree for the disagreement not to matter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
majcosta
2026-07-28 10:25:47 -03:00
committed by majcosta
co-authored by Claude Opus 5
parent 1d0b4beb4c
commit c3e2d1ae3d
3 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ assert.equal(await sent.body.get("files[0]").text(), REPORT);
// junk: client should delete these, so they must be 400
assert.equal((await post("hello")).status, 400);
assert.equal((await post("x".repeat(64 * 1024 + 1))).status, 400);
assert.equal((await post("x".repeat(32 * 1024 + 1))).status, 400);
// throttled: 429, and nothing reaches Discord. reportIsSettled() leaves 429
// unsettled, so the client keeps the report for next launch.