Install Iris on a phone and get its alerts there (#154) #178
No reviewers
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
security
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED!178
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/154-pwa-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #154, except the manual device checks listed at the end.
Part 1: installable
vite-plugin-pwa@1.3.0(injectManifest) and Workbox 7.4.1, pinned exactly.public/iris.svg/?filter=unapproved) and Seasonindex.htmlalways referenced/iris.svg, which never existedfrontend/src/sw/policy.ts).stopImmediatePropagation()for/api/*,/auth/*,/metrics,/openapi.jsonand cross-origin requests, and never callsrespondWith. The browser then fetches exactly as if there were no worker, OIDC redirects included.NetworkOnlyroute, which would still proxy the request.spa.py(#164).sw.tsrun against a fake worker global/apiresponse hasfromServiceWorker() === false, and Cache Storage holds nothing under/api,/author/metricsregisterType: "prompt", with a "New version available: Reload" toast.Part 2: Web Push
pywebpush==2.5.0, inpyproject.tomlanduv.lock(the image installs from the lock since #173).WEB_PUSH_VAPID_*come from env only. Tests prove they're absent from the config export and can't be stored as settings. A mismatched key pair is reported as the reason push is off.python -m app.vapid_keysgenerates a pair.push_subscriptionstable (migration0011, checked up, down and up again).GET /push/config, andPOST /push/test.webhook_dispatcher.dispatch_event, with no second event list. EveryWebhookEvent, including #149's and #148's, gets a formatter, and a test enforces that. Push failures never affect webhook delivery. A 404 or 410 deletes the subscription.https://on port 443 at a known push-service host (FCM, Mozilla, Apple, WNS). Without that, any user could aim the server's POSTs at an internal address.scheme_pushedandquick_push. It's an allowlist, so new events default to admin-only. The role is refreshed at login and re-checked at dispatch.Verification (rebased onto
mainwith #148, #151 and #173)test_web_push.py). ruff and strict mypy are clean,uv lock --checkpasses, and Alembic up, down, up andcheckall pass.tsc, vitest 271 passed, and build (the output containsmanifest.webmanifestandsw.js).pwaPlaywright project uses full Chromium with--unsafely-treat-insecure-origin-as-securefor the CI origin only, sincehttp://iris-<run>:7842isn't a secure context. The existing project still runs where no service worker can register.app.vapid_keyshas no import-time side effects.docker diffis empty, so there are no new write paths.Manual verification (checklist in
docs/setup.md§9–10)Install on Android and iOS; the OIDC round trip and session persistence in the installed app; the shortcuts; the update prompt; a test notification arriving on each platform; a tap opening the right page; and sign-out stopping notifications. Real push delivery can't be tested headless.
🤖 Generated with Claude Code