Skip to content

Render marked Firebase approvals as Android review notifications - #421

Queued
n0rpan wants to merge 8 commits into
mainfrom
mobile/android-owned-approval-notice
Queued

n0rpan wants to merge 8 commits into
mainfrom
mobile/android-owned-approval-notice

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Part of #95. Stacked on #361 for cold and warm launch routing.

The opt-in Firebase build can display a review notification for a marked data-only approval on Android 12 or newer. It accepts only the versioned format and two canonical routing values, uses fixed copy, and expires with the Firebase message. Repeated deliveries update the same notification. Separate requests keep distinct immutable tap intents.

The body tap opens the existing signed approval review. The relay still sends its existing tray payload. The standard APK keeps its existing behavior. Approval decisions and the relay opt-in will follow separately.

Local verification passed:

  • Both Android APK builds, the Firebase packaging checks and documentation checks.
  • Android API 35 instrumentation exercised the packaged renderer and verified legacy, expired, mixed and malformed envelopes, repeated delivery, separate intents, immutable intents and no decision buttons.
  • Tapping both notices in Android’s notification shade captured the first envelope at cold launch and the second in the same running activity. The emulator used fixture data and a private network namespace. It did not receive an alert from the Firebase service or answer a host request.

Read a future FCM session alert from the launcher activity's intent: a
session_ref with a known kind and its exact pairing_hint, mutually exclusive
with approval_ref. Java checks extra presence before reading either value, so
a valid session reference plus a wrongly typed approval_ref is still refused;
an approval reference may carry only an approval or question kind, or omit
kind. Java then validates the action, types, canonical reference, known
session kind and required hint, and keeps the envelope in the bounded dedupe
store. Rust parses it into a typed SessionAlert event that shares the existing
bounded inbox, dedupe and newest-tap rules, and routes only that valid
explicit launch through the shared signed follow_tap session branch. Received
data and background messages are untouched; approval taps keep their legacy
and routed behaviour.

The existing activity, launcher and no-FCM build are unchanged. The relay's
NEW_TASK | CLEAR_TOP click action can recreate the standard-mode activity for
a background-warm tap, which uses the same capture path and is to be verified
on a device; a foreground onNewIntent is not covered by this slice. The relay
does not send a session reference yet and no Android session alert opt-in
control is added.

Checks: cargo fmt --check; host android_fcm_events tests (26); host clippy
-D warnings; Android cargo check with and without android-fcm; the pilot
static check; javac against android-36; and a Java fixture for the reference,
hint and kind validators.
…warm-launch

Restack the Android warm notification-tap change onto origin/main
9276853. Preserve main's #352 FCM bundle builds, #353 session-link
routing and #372 typed notification capture; the resulting diff against
main is limited to the reviewed #361 warm-tap feature paths.
@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:23:31.862988Z c138542 New commits
🔒 Security Review ✅ Completed 2026-12-03T21:26:02.902276Z c138542 Manual request
ℹ️ 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.

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

One combined Android case with #399: leave a marked review notification in the shade, close the Activity with Back, then tap the existing notification. The cold-start fix and notification renderer meet at that tap. It should start a fresh process and open the same signed approval review, without replaying the older tap or sending a decision.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

The combined API 35 emulator rehearsal with #399 passed the lifecycle portion. A review-only notification posted by the FCM renderer stayed in the shade after Back exited the first app process. Tapping that same notification started a different process and drew the app again. The emulator was unpaired and used a fixture payload, so opening the live signed approval on a paired device remains to be verified.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

The paired API 35 rehearsal now also passed with #399. The real review renderer posted a marked notification for a later pending question while an earlier approval remained pending. Back ended the app, and tapping the same notification started a new process and opened the exact question through the signed pairing. The host recorded a thread selection and zero answers. Tapping Send answers produced one answer for the exact scope, question and live token. Replaying the resolved notification started a fresh process and produced no further actions. This used a loopback host and fixture payload. Live FCM delivery and physical Android validation remain open.

Base automatically changed from mobile/android-alert-warm-launch to main December 3, 2026 21:20
…approval-notice-reconcile

# Conflicts:
#	desktop/ox-mobile/README.md
#	desktop/ox-mobile/check-android-fcm.sh
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue c138542

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: c1385429e1

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

After #361 landed, I reconciled this branch with main at 545fc97. The five-file change preserves the Firebase warm-launch Activity and keeps the marked review renderer. The Firebase packaging preflight, Rust format check and diff check passed.

The advisory stock-client job failed in the OpenCode loopback fixture. The installed CLI rejected the positional argument in opencode models ox before the fixture exercised OX. The required mobile checks are still running.

@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