Repository navigation
Queue typed session alerts in the durable FCM relay - #364
Conversation
Validate explicit finished, failed and goal_reached session requests: a
known kind, a canonical s1_-prefixed 32-byte base64url event reference and
a required canonical pairing hint. Render the stateless APNs worker's
fixed copy with data exactly {kind, session_ref: suffix, pairing_hint}.
The session path reuses the approval delivery path for expiry, size,
fid/token targeting, click_action and proxy: DENY, and carries no
approval field. The legacy approval payload and results stay unchanged;
the dispatcher and HTTP surfaces are untouched.
Tests: node --test mobile-push-relay/test/*.test.js (199 pass). New
fcm-session.test.js covers all three kinds, approval byte parity, the exact
session data, validation before access token or transport, expiry, size,
fid targeting and provider answer classification.
Accept an optional finished, failed or goal_reached kind on the authenticated POST /v1/notifications. Absence stays the legacy approval. A typed kind is validated before queueing: the event reference must be the canonical s1_ session reference and the installation id must be the canonical 32-byte value the dispatcher hashes into the pairing hint. Store the kind in delivery schema version 3, with an approval default and a CHECK over the fixed values. A typed kind is refused with kind_unavailable for an APNs binding, before a delivery or enqueue slot exists. True v1->v2->v3 and v2->v3 migrations add only the column, leaving retry, lease, dedupe and ordering state intact. The dispatcher passes kind only to a typed FCM delivery. Approval requests keep approvalRef and the byte-identical FCM payload, and APNs never receives a session field. Tests: node --test mobile-push-relay/test/*.test.js (205 pass).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
/queue 4571e79 |
|
In line to merge. Commit 4571e79 is reviewed with nothing blocking; it has entered the merge queue. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
/queue 4571e79 |
Part of #95. Stacked on #359, which renders the fixed FCM payload.
Accept finished, failed and goal_reached in the host-authenticated notification enqueue endpoint only for FCM. Require the canonical host-issued session reference and an installation ID that can derive a pairing hint. Persist the kind through SQLite and dispatch it using the typed FCM payload. Existing approval requests keep their payload and behavior. Reject an inconsistent typed lease before it can send as an approval.
Migrations from v1 and v2 preserve existing deliveries, leases, retry state, deduplication and registration fences. All 205 relay tests passed, including migration, restart, the typed HTTP contract and the actual FCM adapter payload through dispatch.
This prepares the self-operated relay. Host capability detection, per-device opt-in and pilot deployment follow separately.