Repository navigation
Ask APNs for actions only on eligible approval alerts - #384
Conversation
Send approvalActions: true on the stateless APNs enqueue only for a live exact approval whose AskView lock_screen pair revalidates as two distinct in-bounds decisions with no questions, whose opaque reference and pairing hint are the worker's canonical 43-character forms, and whose paired phone is currently opted in with a matching active APNs installation. Every other alert keeps the earlier body byte for byte, so ordinary, durable and Firebase requests are unchanged. Before retrying an actionable send, recheck liveness, the durable generation and the phone's opt-in, dropping it to the ordinary alert when the opt-in is gone. A worker that predates the field refuses the whole body with 400 invalid_request before the provider is called; the sender retries that exact refusal once without the field so tap-through still works, and never on a timeout, transport failure or any other status. The frame's decisions and questions are revalidated through LockScreenDecisions::validate, so a third choice or a question cannot inherit the pair. Only the boolean crosses the wire: no decision index or token is sent beyond the existing opaque reference.
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 a982b81 |
|
In line to merge. Commit 0eba9af is reviewed with nothing blocking; it has entered the merge queue. |
|
Coordination with #371 and #380: #371 and this PR both rewrite the enqueue/retry loop in |
…pns-action-host-main
|
/queue 0eba9af |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
|
I ran the requested mixed APNs/FCM case on a local integration of #380 ( The test fed held, released and repeated listings of the same approval into the host with three confirmed phone enrollments. The held listing produced zero sends. Release sent the action request only to the opted-in APNs phone. Its explicit legacy-worker refusal produced exactly one ordinary retry with the same reference. The other APNs phone and the FCM phone each received one ordinary approval. Relisting produced no further sends. With the same enrollments on the durable relay, Finished and Failed each took the typed FCM path with registration generation 1. A third typed send that returned capability unavailable produced zero ordinary calls. The test used the real host projection, on-disk enrollment and preference stores, and sender loop with fixture relay responses. Physical provider delivery remains unverified. The host-web library suite passed 237 tests, including I repeated the 237-test host suite with #380 at I reran the same test on the published #371 |
Part of #95. Builds on the signed phone opt-in from #367 and the fixed APNs category in #366. For a live approval with a validated allow-once/deny pair, ask the stateless APNs worker for its fixed category only when the paired phone has opted in and the reference and pairing hint are canonical. Only a boolean is added to that request. Other providers, questions and session alerts keep the existing delivery format.
Recheck eligibility before retrying. If an older APNs worker rejects the unsupported field before dispatch, fall back once to the ordinary tap-through alert without spending a delivery attempt. Ambiguous delivery errors retain the existing retry policy.
Based on
370fc50. All 220ox-host-webtests passed with the server and client features enabled, including preference changes during retry, legacy worker refusal and wire compatibility. Six fixture-only tests were ignored by the unit runner. Formatting andgit diff --checkpassed. A real lock-screen action on a signed iPhone remains to be verified.