Skip to content

Gate typed host relay requests on Firebase session alert support - #368

Queued
n0rpan wants to merge 12 commits into
mainfrom
mobile/fcm-session-alert-host-client
Queued

n0rpan wants to merge 12 commits into
mainfrom
mobile/fcm-session-alert-host-client

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #95. Based on main after #365 merged at 65b7d8ac.

Add a typed host relay client call for finished, failed and goal-reached session alerts. The call requires a canonical reference, a canonical installation ID and a confirmed registration generation. It checks the bearer-authenticated capability at the configured HTTPS origin before enqueueing, using the existing bounded transport and response handling. Unsupported, malformed, extra-field and duplicate-field responses do not enable delivery. The call has no approval fallback.

Verified 20 relay client tests, including exact legacy approval and APNs worker wire bytes, a typed send over fixture TLS, authentication errors and unknown capability results. No production sender uses the method yet.

Checked against main at be0a803e, including #384 and #424. The TLS fixture has one GET handler for both capability endpoints. On recovery head 49e655e6, all 227 host-web library tests passed with nine fixture launchers ignored. The root CLI suite, clippy, formatting, 99 CI helper tests and the full Chromium linked-worker flow passed locally.

A required Ubuntu package run exposed an empty file between creation and the linked-worker fixture’s first write. The fixture now publishes the completed result by atomic rename. On Ubuntu x86-64, 300 deliberately delayed writes exposed 300 early empty reads before the fix and zero afterward. Failed package job · Diagnostic run

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).
Serve authenticated GET /v1/capabilities from the host API. The fixed
{"sessionAlerts":1|0} answer follows the same provider set that narrows
registration, so it reports exactly whether the deployment built the FCM
adapter. The route needs no request body or content type and keeps the
existing no-store response headers. Document the contract and cover auth,
method, path, FCM readiness and service adapter wiring.
@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-03T22:46:29.696246Z 49e655e Draft marked ready
🔒 Security Review ✅ Completed 2026-12-03T22:47:56.476197Z 49e655e 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: 93761b969d

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

Comment thread desktop/ox-host-web/src/push_relay.rs Resolved
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

20da774 requires an object before decoding the capability fields. I reproduced the array accepting the capability before the fix and confirmed that the regression now stops at the GET. All 20 relay client tests passed.

I also ran the exact Rust transport against the actual Node HTTP handler, SQLite store, dispatcher, and FCM adapter over isolated TLS. Versioned registration, typed enqueue, duplicate suppression, stale generation rejection, and the legacy approval payload all passed. Only the external Firebase provider transport was simulated.

Base automatically changed from mobile/fcm-session-alert-capability to main December 3, 2026 20:49
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue b2c28a5

1 similar comment
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue b2c28a5

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Asked for by the maintainer’s queue request, for commit b2c28a5.

@n0rpan
n0rpan marked this pull request as draft December 3, 2026 20:52
@n0rpan
n0rpan marked this pull request as ready for review December 3, 2026 20:52
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Stock clients (latest) failed at tests/fixtures/stock_opencode.py:193. The installed client rejected the provider argument to opencode models ox with “Unexpected positional argument”. I reproduced the same failure with the installed OpenCode 2.4.4. Its help lists opencode models [flags], and the official GitHub latest alias currently points to 2.4.4.

The fixture, launcher and workflow are byte-identical to main at 66f53176. The baseline job passed. The workflow treats the latest-client job as advisory on PRs and required on the scheduled run. The existing queue request still depends on the real OX merge check and both reviews.

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

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

The Ubuntu x86-64 package job failed in the linked-worker browser fixture after both private result checks passed. At linked_workers.py:296, the reader saw parent-tool-result and read an empty string. The HTTP handler’s Path.write_text exposes the final name before it writes the contents. Both the reader and writer were identical to main.

I reproduced the race with the actual fixture HTTP handler on an Ubuntu x86-64 runner. Pausing immediately before the write exposed an empty final file in 300 of 300 requests. Closing a unique temporary file before renaming it into place reduced that to 0 of 300. The reader received every exact output, including an intentionally unexpected result that still failed the original preparing condition. Before-and-after diagnostic

The recovery also aligns the TLS fixture’s GET method with #424. The previous combined queue tree had two identical definitions. Applying the recovery to that tree leaves one, with the action-registration and session-alert capability paths intact.

GitHub ejected the candidate. The Intel package runner also lost communication with GitHub while building the test executables. Its test step never started and its job-log endpoint returned 404. The host recorded no more specific cause. The advisory latest-client job reproduced the OpenCode positional-argument failure.

Pushed both fixture changes together at 49e655e6 after #424 landed. The complete local Chromium flow with stock Codex passed, including hosted parent restart, control and completion. The local CLI suite also passed on this head. A prior local run hit the independently diagnosed updater lock race from #380; I verified the full CLI suite separately with its published updater fix.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2026
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 49e655e

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Asked for by the maintainer’s queue request, for commit 49e655e.

@n0rpan
n0rpan marked this pull request as draft December 3, 2026 22:45
@n0rpan
n0rpan marked this pull request as ready for review December 3, 2026 22:45
@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 was previously deployed

1 inactive deployment
auto-queue — 49e655e6 Deployed Dec 3, 2026 by n0rpan via Queue when green and reviewed #8421
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