Skip to content

Offer iPhone notification actions in paired host settings - #391

Queued
n0rpan wants to merge 8 commits into
mainfrom
mobile/ios-approval-action-settings-stack
Queued

n0rpan wants to merge 8 commits into
mainfrom
mobile/ios-approval-action-settings-stack

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #95. The verified action handler (#387), eligible host sender (#384), and official APNs worker (#366) are on main. The official worker deployment passed its Apple probe.

Offer an off-by-default setting for Allow once and Deny on eligible iPhone approval alerts. Show it only for a signed paired host with active alert enrollment that confirms delivery support. The host reports support for its enabled built-in APNs worker, and rejects an enable when the configured relay cannot deliver the category. The phone falls back to opening the request for review if the host cannot confirm the opt-in and support when a notification action arrives. The original settings API reply stays compatible for callers that omit the capability request.

Reconciled with main at 373f8c9a22ace0643f2ed449b70039b0b3029466. On this tree, 391 mobile library tests, 46 mobile integration tests, 223 host tests, and all 21 worker tests passed. Eight host fixture entry points run under their separate integration harnesses. The tests cover the signed capability response, fallback on unsupported replies, eligibility of the outbound APNs payload, its fixed category, and verification of the live approval before a decision. The prior worker also verified an unsigned ARM64 iOS device build.

Oscar will check the real notification buttons and tap-through after merge with the first available TestFlight build and matching host dev release. Physical-device QA is pending.

The Stock clients (latest) job failed at tests/fixtures/stock_opencode.py:193: upstream OpenCode printed its help text and exited 1 for models ox. This PR leaves that fixture and CLI invocation unchanged. The latest-client lane is advisory on PRs. Admission waits for the required OX merge check.

Add one opt-in switch under Host settings -> Notifications for the signed per-phone native_push_approval_actions setting. Read it only while this pairing's iOS alerts are enrolled and authorized; an old or unknown host keeps the control hidden, and an explicit false stays visible and off.

Clear and invalidate the value when the pairing, consent or enrollment changes, including disabling alerts. A process-wide request id makes a late read or write from a replaced settings state stale. No write, enrollment or permission prompt happens without the switch.

Cover the read and set request shapes, the exact {enabled:bool} reply, and the unsupported or failed-read fallback with tests.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T21:29:25.535475Z 9aa4789 Draft marked ready
🔒 Security Review ✅ Completed 2026-12-03T21:31:02.781414Z 9aa4789 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf30234353

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@n0rpan
n0rpan marked this pull request as draft December 3, 2026 15:49

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Coordination for the review finding: #384 is the host sender and #366 is the APNs category. #384 deliberately adds actions only on the stateless APNs path and falls back to ordinary alerts on old workers, so the signed #367 preference and active enrollment alone do not mean this pairing can show buttons. Please agree on a delivery-capability signal or keep the switch hidden until that path is supported. For the combined signed-iPhone check, confirm an opted-in supported pairing gets the buttons and the unsupported path still only opens the app.

The signed opt-in could say only whether the per-phone setting was
enabled, so the phone offered actions on any configured relay. A request
may now ask for the capability: the host answers support only while its
push service is enabled, holds no credential and uses the built-in
origin. The phone sends that request on every read and write, hides the
control otherwise, and an enable is refused before storage when the
relay cannot honor it. Requests without the field keep the exact old
reply shape.

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Separate Android/iOS overlap to reconcile on the final base: #375 and this PR both replace the same alert_settings import in mobile/notifications.rs. #375 also changes ordinary event writes to Change::Event, while #391 adds the separate ApprovalActions path. Whichever lands second, please keep both types and paths when rebasing. A combined check should confirm that toggling Android session alerts does not change the iPhone action opt-in, and that older hosts still hide each unsupported control.

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

16:08 settings integration request — verified on a disposable tree combining #391 a05ceffa, #375 84a8ca4c and #396 e321f65a.

The Android head has moved past the proposed Change::Event shape. Ordinary event writes still use push_preferences with an event and value. Android uses native_fcm_session_alerts in android_alerts.rs, and iPhone uses native_push_approval_actions with include_support in notifications.rs. The two app heads merged with a conflict only in the tests in alert_settings.rs. Keep both test groups. On the combined host, keep both signed action variants in remote_settings.rs.

A focused host test signed requests for two distinct paired phones using an active FCM enrollment and a loopback HTTPS relay answering the real capability probe. It toggled Android on and off and read the iPhone action preference after each write. The stored opt-in stayed on for both the separate iPhone and the edited pairing. Ordinary Finished preference edits preserved the Android value. The broader suites passed 390 mobile and 224 host tests (seven host fixture launchers ignored by the unit runner). Legacy or refused iPhone replies and Android replies without affirmative capability leave their respective controls hidden.

The failed workbench job exited 100 before running tests. Ubuntu Snapshot returned HTTP 503 for all four Noble indexes. On the single retry of the same head, the workbench job passed and the OX merge check passed. #386 added a signed archive fallback on main.

#366 landed and its official worker deployment passed the Apple BadDeviceToken probe. #391 stays draft for the #387 base, the #384 sender and the signed physical-iPhone check. The device check still needs an opted-in, supported pairing showing Allow once and Deny on a real approval, and an unsupported path opening the app for review.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

We’ll run the physical-iPhone check after #391 merges, on the first TestFlight build containing it and a host release containing the matching sender and settings support. Keep the draft until #384 and #387 land, then reconcile the branch and use the usual review and merge queue. The APNs worker deployment and combined software checks are already recorded above.

On the phone, expand an eligible approval notification with actions enabled and confirm Allow once and Deny on separate harmless requests. On an unsupported route, tapping the alert should open the request for review. Record the TestFlight build and host version with the result.

Base automatically changed from mobile/ios-verified-approval-action-main to main December 3, 2026 21:24
@n0rpan
n0rpan marked this pull request as ready for review December 3, 2026 21:28
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 9aa4789

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

In line to merge. Commit 9aa4789 is reviewed with nothing blocking; it has entered the merge queue.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

I checked this exact head (9aa4789) with the Android approval-action candidate, #396 and #375 on local integration d835bde. Both signed settings paths and both groups of parser tests survived the merge. The added host regression enables iPhone approval actions and reads them back after turning off the same pairing’s typed Firebase alerts. That request clears only the Firebase preference.

The integrated tree passed 396 mobile and 238 host tests, host Clippy, Firebase preflight, and an unsigned ARM64 iPhone build with xtool. Production delivery and physical-device behavior still need verification.

@n0rpan
n0rpan added this pull request to the merge queue Dec 3, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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