Alerts: the push notice can't be repaired or dismissed when this device can't make a push subscription
What happens
After updating to v0.4.19 (which shipped #1995), every client I use (the browser, the installed web app and the app) shows the alerts notice over the pane:
This device's push subscription is missing. Turn alerts on again.
Clicking Turn alerts on again does nothing visible: the button flickers to "Turning alerts on…" and back, and the notice stays with the same text. The notice has no way to close it, so it sits over the pane for good.
Expected: the repair turns alerts on, or at least says why it can't, and the notice can be dismissed.
Why
classifyPushHealthreportsmissingwithrepair: truewhenever alerts are on, permission is granted and the browser holds no subscription. It assumes subscribing again helps.- On a device that cannot make a subscription, the repair fails every time.
enableNotifications(src/lib/useNotifications.ts) catches the error, logsweb push unavailable, alerts stay tab-onlyto the console and returnsfalse.ensurePushSubscriptionalso returnsnullwithout an error whennavigator.serviceWorker.readynever settles. runPushActionrecordsfailed, then the look that follows finds the samemissingfault and drops the result (refreshPushHealthkeeps a result only when no fault is found). So neither the notice nor Settings → Alerts ever says the repair failed. Settings' hint also checkshealth.problem === "missing"beforeresult === "failed".PushHealthNoticeis not dismissible by design. That's fine while a repair can help, but here it can't, so the user is stuck with it.
Before #1995 this state was silent: alerts stayed tab-only. That's why it showed up as soon as v0.4.19 was installed.
Evidence
On my Windows PC running v0.4.19 (state dir ~/.config/herdr-web-ui), the server has never stored a subscription: there is a vapid.json but no push-subscriptions.json.
The request log (http-requests.jsonl) has no /api/push request at all over about 50 minutes of use, including clicks on the button, so the repair gives up in the browser before it reaches the PC.
The browser in the screenshot is Brave, where pushManager.subscribe() rejects until Use Google services for push messaging is turned on in its privacy settings (it is off by default).
I have not yet confirmed which of the two browser-side failures (subscribe rejected, or the service worker never ready) applies on each of my devices.
Suggested fix
- A repair that makes no subscription says why: the browser or app would not make one (with the Brave setting named in Brave), the service worker isn't running, or the PC did not take it. That reason stays in the notice and in Settings while the fault it was meant to fix is still there.
- The notice gets a dismiss button. A dismissal is remembered on the device for that fault, and ends when a different fault appears, when a look finds alerts working, or when alerts are turned off. Settings → Alerts keeps telling it.
I'll open a PR with this.