fix(05-review): WR-05 re-confirm push subscription server-side on health-check mount

This commit is contained in:
Lucas Berger
2026-06-09 22:21:16 -04:00
parent 76e0fb9588
commit 814d29dbdd
@@ -155,6 +155,14 @@ export function usePushSubscription(): UsePushSubscriptionReturn {
const existingSub = await registration.pushManager.getSubscription()
if (existingSub) {
// Re-confirm server-side record (handles 410-prune recovery — D-10).
// The upsert on endpoint is idempotent; this is a no-op if the record exists.
await fetch('/api/push/subscription', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify(existingSub.toJSON()),
}).catch(() => {}) // non-blocking — ignore network failures
setIsSubscribed(true)
return
}