tests: BUG-8 ws reconnect RED, BUG-7 reorder no-undo doc, ws _test accessor

server/tests/ws-reconnect.test.js: subscribe, write (fires), force-drop WS,
write again (must still fire). RED on current. wsReady=null after drop,
no reconnect, subscribers dead forever. Display frozen.

src/storage/ws.js: added _test accessor (getWs, forceDrop, getReady,
docSubs, collSubs) for reconnect test. Test-only, no behavior change.

TODO: BUG-7 (reorder no undo), BUG-8 (ws reconnect) added.
This commit is contained in:
david raistrick
2026-06-30 13:59:58 -04:00
parent c90fc6ffb0
commit e514a48d6e
3 changed files with 75 additions and 0 deletions
+11
View File
@@ -96,6 +96,17 @@
- Fix: reorder must also update turnOrderIds to match new participant order
(within same-initiative tie).
### BUG-7: reorderParticipants has no undo
- Test: `shared/tests/turn.undo.test.js` 'reorderParticipants has no undo' (GREEN doc).
- `reorderParticipants` returns `log: null`. Other ops return `log.undo`.
- Cannot undo drag-drop. Candidate for undo system (M6).
### BUG-8: ws adapter has no reconnect
- Test: `server/tests/ws-reconnect.test.js` (RED).
- WS dies (idle/error/close) → `wsReady=null`, subscribers dead forever.
- Display frozen until full reload.
- Fix: `onclose` → reconnect + re-subscribe existing paths.
## Pipeline
- [ ] Red test: dead participant still in turnOrderIds, turn still advances to them
- [ ] Fix `shared/turn.js`: don't drop dead from turn order