Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
/live closes any text frame over 4096 bytes with 1009, counted by the relay because Bun's ws ignores maxPayload #130
/live now counts each message's bytes with frameBytes before parsing it. Anything over 4096 bytes closes the socket with 1009. The check is in lobby.ts, and the maxPayload option stays in place, but Bun's ws ignores it.
stopped closed without shipping deploy da0a864
2 earlier comments
/live now counts each message's bytes with frameBytes before parsing it. Anything over 4096 bytes closes the socket with 1009. The check is in lobby.ts, and the maxPayload option stays in place, but Bun's ws ignores it. The src/lobby tests pass, including the new one. I read the tsc --noEmit output as clean, but it also printed a "bun is unable to write files to tempdir" error, so I can't say the type check fully ran.
I didn't take code from pull #25's branch, which isn't in this clone. frameBytes and TOO_BIG_CLOSE were already in src/frame-limit.ts, so I used them directly.
The new test in lobby.test.ts pins the boundary:
- 4096 bytes: a frame of exactly 4096 bytes is accepted and handled (it gets the normal "history before which line?" reply).
- 4097 bytes: a 4097-byte frame closes with 1009 and is not handled.
- Bytes, not characters: a frame of
épadding (two bytes each) is over 4096 bytes but under 4096 characters, and it also closes with 1009.
/live now counts each message's bytes with frameBytes before parsing, and closes the socket with 1009 when a message is over 4096 bytes. The src/lobby tests pass. The tsc --noEmit output looked clean, but it also printed a "bun is unable to write files to tempdir" error, so I can't say the type check fully ran.
The check on #130 failed because forge.json had check.limits but no check.run. I added check.run: it installs dependencies, runs bun x tsc --noEmit, then bun test in Software/so101. I haven't run that exact command here, and I haven't seen the forge's check pass on this push yet.
What to look at
Software/so101/src/lobby.ts: the size check sits in the/livemessage handler. It usesframeBytesandTOO_BIG_CLOSEfromsrc/frame-limit.ts, which were already in the repo.maxPayloadstays on the server, but Bun'swsignores it.Software/so101/src/lobby.test.ts: a new test pins the boundary.
- A frame of exactly 4096 bytes is accepted and handled.
- A 4097-byte frame closes with 1009 and isn't handled.
- A frame of two-byte é padding that is over 4096 bytes but under 4096 characters also closes with 1009, so the limit is in bytes, not characters.
🤖 Generated with Claude Code
Declined: the failing check can't be fixed from this branch. The error is main: forge.json: check.run is required. The "main:" prefix means the forge is validating forge.json as it stands on main, and main declares check.limits but no check.run. Run log: https://forge.open-platform.sh/trevato/arm/runs/01m5e189xext6x0n9rar5k1ja5
/livenow counts each message's bytes withframeBytesbefore parsing it. Anything over 4096 bytes closes the socket with 1009. The check is inlobby.ts, and themaxPayloadoption stays in place, but Bun'swsignores it. Thesrc/lobbytests pass, including the new one. I read thetsc --noEmitoutput as clean, but it also printed a "bun is unable to write files to tempdir" error, so I can't say the type check fully ran.I didn't take code from pull #25's branch, which isn't in this clone.
frameBytesandTOO_BIG_CLOSEwere already insrc/frame-limit.ts, so I used them directly.The new test in
lobby.test.tspins the boundary:épadding (two bytes each) is over 4096 bytes but under 4096 characters, and it also closes with 1009.Closes #123