Skip to content

Add a per-host Android session alert setting - #375

Draft
n0rpan wants to merge 9 commits into
mainfrom
mobile/android-session-alert-settings
Draft

n0rpan wants to merge 9 commits into
mainfrom
mobile/android-session-alert-settings

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #95. Stacked on #361 for warm notification routing. This PR remains a draft until the host and relay support under #396 and #371 is available.

Offer a per-host Android session-alert setting in the existing Firebase notification card. Show it only while notifications are authorized and the signed host reply confirms an active installation on a capable relay. The opt-in starts off and changes only the active pairing. Check again refreshes support without replacing a write in flight, and the card preserves feedback if support disappears while the user makes a change.

The restacked branch passed 385 native library tests. The revised ARM64 fixture bundle from the combined app and host stack passed bundletool validation and 16 KiB alignment. An earlier combined bundle covered Android 16 cold launch and warm synthetic alert capture. Google Play installation and real Firebase delivery on a physical device remain open.

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.
Read and change only the host's optional fcm_session_alerts preference,
behind the existing pairing and generation checks. An old host that omits
the key, or a failed read, hides the switch; an explicit false stays
visible and off. The switch never enrolls, prompts or enables itself.
@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-03T12:36:44.399603Z e0ce399 PR opened
🔒 Security Review ✅ Completed 2026-12-03T12:38:38.452739Z e0ce399 PR opened
ℹ️ 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

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

The stock-Claude host CI job failed during dependency setup for gpui-mobile: the fetch returned HTTP 403 four times before any fixture ran. git ls-remote confirms the requested revision 5f6afdb570ac2d14f239c8b1e81e483392e9afdd remains upstream HEAD. The exact Android release APK built and passed alignment locally. I’ll retry the failed CI job once after the run settles.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Combined this app stack with the Play bundle changes from #352 for local QA. The unsigned ARM64 Firebase AAB passed bundletool validation. The fixture-signed APK generated from the bundle passed APK signature and 16 KiB alignment checks, installed in the API 36 emulator, opened OX from a cold synthetic session-alert intent, and delivered a second intent to the same running activity and process. The emulator used a synthetic Firebase configuration and remained unpaired. Exact signed conversation routing from a paired phone, Play distribution, and provider delivery remain pending.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

The single retry of the failed stock-Claude job passed for this exact head. The broader workflow is green on attempt 2.

…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.
The session-alert switch now uses the dedicated native_fcm_session_alerts
action instead of reading the stored fcm_session_alerts preference as if
it proved delivery. The control appears only when the host confirms a
current FCM enrollment on a credentialed relay that advertises typed
session alerts; an old host, an unsupported relay or a transient failure
hides it until a manual Check again.

A manual check refreshes the capability, and a preference write already in
flight keeps its completion and is followed by the requested read rather
than being replaced. An explicit disable keeps the control visible and
off even when the host could not confirm relay health. The normal
push_preferences per-event flow is unchanged.
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

I’m checking the settings interaction requested on #391 against your Android app head 84a8ca4 and the host capability from #396. I’m using a disposable checkout and will post the tested resolution and results on #391 for whichever branch lands second. The #375 and #396 branches stay with their owner.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

Combined settings results on #391. Both signed settings survived the integration. At these heads the app conflict was in the two adjacent test groups in alert_settings.rs. Please keep both groups if #375 lands second. #396’s host action and #391’s host action also both need to survive the enum merge.

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

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