Skip to content

E5: Waiting Queue System - Tasks

Epic: E5: Waiting Queue System


E5-F1: Queue Join & Position Assignment

Feature: E5-F1: Queue Join & Position Assignment

Status Task Verification
Create Redis sorted set for queue (match_id -> {user_id: timestamp}) Can add users
Implement POST /queue/{match_id}/join endpoint Returns position
Position = rank in sorted set + 1 Position accurate
Return estimated_wait_time and total_queue_size Values calculated
If user already in queue, return existing position No duplicate entries

E5-F2: Real-Time Position Updates

Feature: E5-F2: Real-Time Position Updates

Status Task Verification
Implement WebSocket or Firebase channel for queue updates Connection established
Send position update every 60 seconds Updates received
Include position, estimated_wait, total_size in update All fields present
Client-side: decrement position locally every second Smooth countdown

E5-F3: Queue Progressive Notifications

Feature: E5-F3: Queue Progressive Notifications

Status Task Verification
Send push on significant position change Push sent
Send push at position ~50: "You're almost at the front!" Notification text correct
Send push at position 1: "It's your turn!" Notification text correct
Include deeplink to purchase flow Deeplink opens correct screen

E5-F4: Purchase Window Enforcement

Feature: E5-F4: Purchase Window Enforcement

Status Task Verification
Set purchase window start time when user reaches position 1 Timestamp recorded
Set 20-minute window expiration expires_at = start + 20min
Remove user from queue if window expires without purchase User removed
Send push: "Your purchase window has expired" Notification sent
User must rejoin at end of queue New join gets last position

E5-F5: Queue Connection Resilience

Feature: E5-F5: Queue Connection Resilience

Status Task Verification
Track last heartbeat timestamp per user Heartbeat updated on activity
Keep position for 30 minutes after last heartbeat Position retained
On reconnect within 30 min: restore position Same position returned
On reconnect after 30 min: position lost User not in queue

Last Updated: January 2026