docs(push): bring web push into scope - #465
Conversation
New §2.6 (how the service worker rings and renders, never writes), §3.5 (the two server changes: platform web and CORS), the platform matrix, flow rows, PushPlatform::Web, Settings copy, the T4.5 / PR-4c task behind a capability flag, web tests, and §14 item 7 with what to verify against the real isolated bundle.
Codex Review SummaryThis 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. |
|
Warning Review limit reachedNext included review available in 19 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fc9cc7a19
ℹ️ 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".
| | T4.3 | Golden for the settings screen states (enabled, disabled, refused, unsupported, denied) | `test/features/settings/goldens/` | | ||
| | T4.4 | iOS: APNs key in the Firebase project (operator task, documented), `Runner.entitlements` `aps-environment`, `GoogleService-Info.plist`, `FirebaseApp` registration in `AppDelegate`; `docs/firebase-setup.md` updated; web section states the server gap and #133 is re-scoped | `ios/Runner/`, `docs/firebase-setup.md` | | ||
| | T4.4 | iOS: APNs key in the Firebase project (operator task, documented), `Runner.entitlements` `aps-environment`, `GoogleService-Info.plist`, `FirebaseApp` registration in `AppDelegate`; `docs/firebase-setup.md` updated | `ios/Runner/`, `docs/firebase-setup.md` | | ||
| | T4.5 | Web (closes #133), behind the server's `web` platform and CORS (§3.5): real VAPID key read from a build-time define (`--dart-define=FCM_VAPID_KEY`, documented for forks), `firebase-messaging-sw.js` rewritten — real config from the same source as `firebase_options.dart`, no payload routing, `chat_wake` shown as a content-free "New message", tap focuses or opens `<base>#/notifications` — and registered through `getToken(serviceWorkerScriptPath:)` under the deployed base path; `PushPlatform::Web`; `isSupported` on web reads `Notification` + `PushManager` and a `pushWebEnabled` flag that stays off until the server ships; `pages_bundle_test.dart` guards the worker's placement next to the isolation shim, the base path and the absence of payload routing; the smoke test asserts the worker registers on the isolated page without errors and that `coi-serviceworker` still isolates; Settings copy for the 48 h limitation | `web/firebase-messaging-sw.js`, `web/index.html`, `push_notification_service.dart`, `rust/src/api/push.rs`, `test/web/`, `.github/workflows/web-build.yml`, l10n | |
There was a problem hiding this comment.
Specify a supported custom-worker registration path
With the pinned firebase_messaging ^15.1.3, FirebaseMessaging.getToken accepts vapidKey but has no serviceWorkerScriptPath parameter. Therefore T4.5 cannot establish the proposed /app/ worker and separate scope through this call; falling back to Firebase's default worker lookup also conflicts with the sub-path deployment and the existing isolation-worker requirements. Specify a supported upgrade, JS interop, or combined-worker approach before treating PR-4c as implementable.
AGENTS.md reference: AGENTS.md:L39-L40
Useful? React with 👍 / 👎.
| Browser support: Chrome, Edge and Firefox on desktop and Android; Safari 16.4+ on | ||
| macOS and iOS only for an installed (home-screen) PWA, which the deployed bundle is | ||
| not today (`--pwa-strategy=none`). Safari is therefore "not available" until that | ||
| changes, and the capability check reads the `Notification` and `PushManager` APIs, |
There was a problem hiding this comment.
Decouple Safari support from the Flutter PWA strategy
--pwa-strategy=none only disables Flutter's generated caching service worker; it does not prevent installation as a Home Screen app, and this bundle already has a standalone manifest and another service worker. Moreover, macOS Safari Web Push does not have iOS's Home Screen-only restriction. Treating Safari as unavailable until this build flag changes would unnecessarily exclude supported users; detect the push APIs and, on iOS/iPadOS, standalone installation instead.
Useful? React with 👍 / 👎.
Summary
docs/PUSH_NOTIFICATIONS.mdtreated Web Push as a non-goal because the server rejectsplatform: web. This brings it into scope as a real platform, with the server prerequisites named precisely and the client work specified behind a capability flag so it can merge before the server changes land.trade_update, shows its own content-free "New message" forchat_wake(Chrome revokes subscriptions whose push events show nothing), and a tap focuses or opens the app at/app/#/notifications. The worker never loads the wasm core, never opens IndexedDB, never decrypts. The tab resyncs onhidden → resumed, which PR-0b already wires.mostro-push-serverat1ccf425: acceptplatform: "web"(thePlatformenum and the route validation), and CORS for the app's origin. There is no CORS layer today, and the page is cross-origin isolated, so without it the browser blocks every call to the server.workmanageron the web andperiodicSyncis Chromium-only for installed PWAs, so a web registration ages out 48 h after the last run. The Settings copy on web says so.--pwa-strategy=none). Capability reads theNotificationandPushManagerAPIs, not the user agent.getToken(serviceWorkerScriptPath:),PushPlatform::Web, static guards inpages_bundle_test.dart, and an opt-in smoke assertion that the worker registers on the isolated page next tocoi-serviceworkerwithout breaking isolation.importScriptsfromgstatic.comunder the isolated page, coexistence with the shim's scope andclients.claim(), registration under/app/.Test plan
mostro-push-servercheckout (Platformenum instore/mod.rs, validation inroutes.rs, noactix-corsinCargo.toml); every client claim onmain(firebase_options.dartweb block is real,web/firebase-messaging-sw.jsis aREPLACE_MEplaceholder with arouteFromPayloadmirror,firebase_messaging_web4.2.5 exposesserviceWorkerScriptPath).Manual testing
docs/PUSH_NOTIFICATIONS.mdon GitHub and check the new §2.6 and §3.5 anchors resolve from the table of contents.src/store/mod.rsandsrc/api/routes.rsinmostro-push-serverat1ccf425, and confirmPlatformhas onlyAndroidandIosand thatCargo.tomlhas no CORS crate.web/firebase-messaging-sw.jsonmain, and confirm theREPLACE_MEconfig and therouteFromPayloadmirror it describes.CLAUDE.md"Web (wasm)" and confirm the constraints it cites (cross-origin isolation, the shim as first script,--pwa-strategy=none).mainexcept the ones it says it adds.