E5-F2: Real-Time Position Updates¶
Delivered by waiting-room
This feature is implemented by the standalone waiting-room service. The mobile client opens WSS /tickets/{id}/ws?token=<ticketToken> on waiting-room; the server pushes state on connect and position_changed, admitted, expired, session_expired, cancelled events thereafter. Cross-instance fan-out runs via Valkey Pub/Sub inside waiting-room. There is no SSE fallback — polling GET /tickets/{id} is the documented degraded mode.
Epic: E5: Waiting Queue System
Size: M (Medium)
Problem / Outcome¶
Users see their queue position updating in real-time.
Scope¶
In-Scope:
- Client countdown (decrement every second)
- Server sync every 60 seconds
- WebSocket or Firebase channel for updates
Out-of-Scope:
- SMS updates
Acceptance Criteria¶
- AC1: Client decrements position locally every second for smooth UX
- AC2: Server syncs actual position every 60 seconds
- AC3: Position updates received via WebSocket/Firebase while app is open
Data Model Impact¶
No new tables required.
Real-time channel:
- Firebase topic: queue/{match_id}/{user_id}
- or WebSocket: /ws/queue/{match_id}
Message format:
{
"position": INTEGER,
"estimated_wait_minutes": INTEGER,
"queue_size": INTEGER,
"sync_at": TIMESTAMP
}
Permissions/Roles¶
- Authenticated user in queue
How to Verify¶
npm test -- --grep "position updates"
Expected: Position updates flow correctly, sync corrects drift.
Dependencies¶
Implementation Tasks¶
Doc References¶
Last Updated: January 2026