bug: GM sees no walls after reconnect/reload #87
Notifications
Due Date
No due date set.
Blocks
#77 M4: real-phone playtest gate (Note 10, 60 fps)
SirStone/FFF_vtt_frozen
Reference: SirStone/FFF_vtt_frozen#87
Reference in New Issue
Block a user
Part of #63
Problem
GM walls vanish from the client after a GM tab reload/reconnect even though the server still holds them (it still blocks player sight). In a browser dry-run: create walls, reload the GM tab ->
canvas.dataset.walls === '0', no lines, and the GM cannot select, open or delete any wall. A fresh GM WebSocket does receive awallssnapshot, so the data exists.Cause
DESIGN §6.1 fixes the frame shape: the
wallssnapshot is{t:"walls", scene, walls:[{id, a, b, ...}]}—scenelives on the frame and each entry carries only the wall fields; thewalldelta is{t:"wall", scene, id, a, b, ...}.The server follows DESIGN (
wallsFramecarries the framescene;wallObjectOfentries deliberately omit it), but the client deviates:wallViewFromFramerequiressceneon the object it parses and thewallsreducer passes each snapshot entry, so every entry fails validation and the wall slice stays empty. Deltas work because they are parsed from the whole frame.Fix direction
Bring the client back to DESIGN §6.1, not the server: parse a
wallsentry with the enclosing frame'sscene(and remain tolerant of an entry that carries its ownscene). No change to wall data a player may receive.Acceptance
wallssnapshot frame (frame-levelscene, entries withoutscene) loads every wall.sceneonly at frame level).Proven at
WS black-box + client reducer + e2e (
devbox run test,devbox run client-test,devbox run e2e).Fixed on main in
b938e6f.Decision: DESIGN §6.1 is explicit: the
wallssnapshot is{t:"walls", scene, walls:[{id, a, b, ...}]}—sceneon the frame, entries carry only the wall record — while awalldelta is{t:"wall", scene, id, a, b, ...}. The server matched DESIGN; the client deviated. So the fix is client-side:wallViewFromFrametakes the enclosing frame'sscene, with an entry's ownsceneas the tolerant fallback. No wire shape changed.Tests: client reducer fed a real snapshot frame (frame-level scene, scene-less entries); WS black-box pin that each snapshot entry equals the delta wall record; e2e GM draws walls, reloads, selects the door and toggles it, then a same-state-dir server restart reconnects to the same two walls.
Why e2e missed it: all wall e2e paths built walls in the same live session, so they exercised deltas only and never the snapshot→reducer path; the client unit test's snapshot fixture wrongly put
sceneinside each entry, so it passed against the client's deviation. Both gaps are now covered.Leak check unchanged: players still receive no
walls/wall/wall_goneor wall fields; the wall wire is GM-only except the allowed marker. Full gate green (test,client-test,e2e) plusmutation.