Skip to content

feature: urgent push for match found and incoming admin calls - #443

Merged
lukepolo merged 3 commits into
mainfrom
feature/match-found-push
Sep 29, 2026
Merged

lukepolo merged 3 commits into
mainfrom
feature/match-found-push

Conversation

@lukepolo

@lukepolo lukepolo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Sends an urgent native push when a matchmaking ready check starts ("Match found") and when an admin starts talking to a player from the camera grid ("Admin is calling you").

  • New MatchFound/AdminCall types, each with its own push category. They use an urgent delivery policy: TTL 30s, Urgency: high, sent through quiet hours, no buttons. The payload adds urgent, ttl and expiresAt.
  • The rows are push-only (in_app = false), so they never reach the bell. Urgent fan-outs are sent directly instead of queueing behind the broadcast worker.
  • A match-found row is retracted when the player accepts or when the ready check ends.
  • The admin call only rings when an admin or organizer calls a roster player or coach of a live match, at most once per player per match per minute. A hangup or an answer retracts it.

Merge/deploy: pairs with web#623; run hasura metadata reload after deploy (new is_enum values).

Tests: the caller/target gate, the hangup re-arm guard, the unqueued urgent send, the accept retraction, label escaping, replacing the previous ring, TTL/urgency, the quiet-hours bypass and expiresAt each fail without their code. Manual QA: queue with 5stack in the background on an Android phone and confirm it rings. Keep the phone offline for more than 30s and confirm no stale "Match found" arrives. Based on DEAFCS be753fc, 2c3ca70

A found match and an admin starting a camera call now push to the player's
devices through the normal notifications pipeline, as push-only rows
(in_app = false) that never reach the bell.

- MatchFound / AdminCall notification types, their own push categories
  (match_found, admin_call; on by default)
- "urgent" delivery policy: sent at once, through quiet hours, with
  TTL 30 / Urgency high on the web-push request and urgent + ttl in the
  payload for the service worker
- notifyPlayers({ inApp: false }) writes rows only for subscribed players
- matchmaking pushes every player when a ready check starts and deletes
  the rows when the confirmation is removed; never blocks the ready check
- an admin's talk publish rings the player once per call (redis NX 60s);
  hanging up retracts and re-arms, the player answering retracts
- ring only for an admin/organizer caller, and only a roster player or
  coach of a match still being played; an organizer's "all" scope never
  checked the target, so any match organizer could push to anyone
- the ring guard outlives a hangup (one ring per player per match a
  minute), so publish-then-hangup cannot be looped
- urgent fan-outs claim their rows and send directly instead of waiting
  behind the single-concurrency broadcast worker
- accepting a ready check retracts that player's MatchFound row
- escape the match label in the AdminCall message; a new ring replaces
  the previous row for that player and match
- expiresAt in urgent payloads for the service worker
# Conflicts:
#	src/notifications/notifications.service.spec.ts
@lukepolo
lukepolo merged commit be978e3 into main Sep 29, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/match-found-push branch September 29, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant