Files
buzz/mobile/test/shared
Matt Toohey a6294cc62e fix(mobile): allow relay-sized join policy responses
Mobile read GET /api/join-policy through the generic 64 KiB hosted
response cap, but the relay allows each policy markdown document up to
256 KiB and Desktop accepts a 4 MiB policy response. A self-hosted
relay with a valid policy over 64 KiB was joinable on Desktop but
failed on Mobile with an invalid-response error before consent could
render, and every retry hit the same cap.

boundedHttpResponse and readJoinResponse now take a maxBytes that
defaults to the existing 64 KiB hostedResponseMaxBytes. Only
loadJoinPolicy opts into the 4 MiB cap that matches Desktop, so the
accept-policy, claim, and other hosted replies keep their limit. The
reader accumulates into a BytesBuilder so a multi-MiB body is not held
as a list of ints.

The invite consent journey now serves a policy over 64 KiB and
asserts that Mobile loads its full terms and claims only after native
acceptance. The hosted-admission "oversized policy" row used bare
whitespace, which failed as invalid JSON whatever the cap was. It now
sends valid JSON padded past 4 MiB. A focused test serves a relay-sized
policy alongside an accept-policy reply over 64 KiB: the policy reaches
consent, the reply is rejected, and no claim is sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-10-29 19:31:19 +11:00
..