debugging
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m30s

This commit is contained in:
2026-04-18 11:52:25 -04:00
parent 3d5f84579b
commit d3ce54a1ff
2 changed files with 9 additions and 27 deletions

View File

@@ -59,7 +59,12 @@ export async function subscribeToPushWithResult(): Promise<PushSubscribeResult>
let registration: ServiceWorkerRegistration
try {
// Timeout after 10 s — if SW never activates, don't hang forever
// Explicitly register the SW so we don't race against index.html's 'load' handler.
// navigator.serviceWorker.register() is idempotent — it returns the existing
// registration if one already exists and does not re-install the worker.
await navigator.serviceWorker.register('/sw.js')
// Now wait for it to become active. Use a generous timeout for slow mobile networks.
registration = await Promise.race([
navigator.serviceWorker.ready,
new Promise<never>((_, reject) =>