Push: surface delivery failures (no longer a silent success) (#157)
A failed web push (e.g. VAPID key mismatch -> 401/403) was swallowed: /push/test still returned 202 and the UI showed 'Sent', while the only trace was a journald WARNING. Now: push.send logs failures to the errors JSONL (phase=push) so they show up like other errors; /push/test returns a 'failed' count; and the 'Send test' button reports 'No device' / 'Sent' / 'Failed' from the real result. Document the VAPID env vars (missing from thermograph.env.example) and how to pin/diagnose them.
This commit is contained in:
parent
906d590529
commit
dba45a1942
1 changed files with 10 additions and 2 deletions
|
|
@ -145,8 +145,16 @@ async function renderPushBar() {
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
const original = btn.textContent;
|
const original = btn.textContent;
|
||||||
try {
|
try {
|
||||||
await pushClient.sendTest();
|
const r = await pushClient.sendTest();
|
||||||
|
if (!r.devices) {
|
||||||
|
btn.textContent = "No device";
|
||||||
|
alert("No device is registered for push on this account. Turn alerts off and on again on this device to re-subscribe.");
|
||||||
|
} else if (r.sent > 0) {
|
||||||
btn.textContent = "Sent ✓";
|
btn.textContent = "Sent ✓";
|
||||||
|
} else {
|
||||||
|
btn.textContent = "Failed";
|
||||||
|
alert("The push service rejected delivery to this device. Turn alerts off and on again to re-subscribe; if it keeps failing, the server's push (VAPID) keys may have changed.");
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(err.message || "Couldn't send a test notification.");
|
alert(err.message || "Couldn't send a test notification.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue