Repository navigation
fix(id/web): validate /api/world/host-view + /api/world/invite payload shapes - #7840
developing-today[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Superseded by #7858, which is now the combined fix for #7831. This PR's surviving cases (numeric |
Fixes #7831
world.ts bare-cast both HTTP responses while the WebSocket frames in the same file are carefully guarded. A wrong-shape 200 leaked a raw TypeError as the host-view status, and for invite it persisted the literal string "undefined" as the join capability in sessionStorage while reporting success.
This validates both payloads at the fetch boundary against the world_ws.rs contracts (HostViewResponse: numeric records_sequence, object records, string-or-null next_after, guarded snapshot/view when present; invite: non-empty string capability + display_name) and fails closed through the handlers own error vocabulary ("Host view unavailable" / "Invite failed"). New regression suite world-shape.test.ts covers the malformed cases from #7831 (18 tests).
Tests: world-shape.test.ts 18/18 pass; world-rejoin.test.ts 3/3 pass; tsc --noEmit clean. Full web suite run under extreme laptop load showed only the known pre-existing search-panel failure plus load-timeout flakes in the new file, since hardened with explicit 30s test timeouts and re-verified green standalone.
Queue note: task 14007 was claimed by lane code-t; its lease expired during long test runs, lane code-m re-claimed, found this work in progress, and parked the task with the resume condition that the owning session opens this PR. The resuming lane can merge under the standing criteria once Codex/CI disposition is recorded.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.