Used for every feature that has two or more users acting on shared state at the same time (e.g., Med Royale, live tournaments, duel rooms).
| Scenario | Expected Behavior |
|---|---|
| Player tab killed mid-FFA | Room completes anyway; remaining players receive scores without hanging. |
| Host closes page mid-round | Phase transitions continue automatically via server-driven timers. |
| Player joins after registration closes | Immediate clean rejection message; no half-registered state. |
| Rapid double-click on join/answer | Exactly one write is processed (Idempotent). |
| Wrong/missing answer | Scored 0 without crash; leaderboard still computes accurately. |
| Client vs Server winner race | Server result wins exclusively (Server Authority). |
| Page refresh mid-duel | Player immediately reconnects to same active duel with preserved score. |
[ ] 1. In a staging/emulator environment, clean only the test state you created in Firestore / RTDB (never delete others' data or write to production without Sohail's explicit approval).
[ ] 2. Join Flow โ All accounts register and join in correct order.
[ ] 3. Phase 1 (FFA) โ All accounts submit answers; verify scores in DB.
[ ] 4. Transition โ All players land on countdown/wait screen simultaneously.
[ ] 5. Phase 2 (Brackets) โ Matchups generated correctly; byes handled cleanly.
[ ] 6. Duels โ Both players see synchronized questions; results match on both screens.
[ ] 7. Finals โ Champion displayed; eliminated players see clear elimination screen.
[ ] 8. Final DB Audit โ Full dump of room document matches final UI state 100%.