From 5f78294cd11fd5053e049006f72dedf0cf671eb4 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sun, 19 Apr 2026 23:04:36 -0700 Subject: [PATCH] Longer linger for web push mobile error --- frontend/src/hooks/usePushSubscription.ts | 1 + frontend/src/test/usePushSubscription.test.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/hooks/usePushSubscription.ts b/frontend/src/hooks/usePushSubscription.ts index b4ddcf5..4fa1794 100644 --- a/frontend/src/hooks/usePushSubscription.ts +++ b/frontend/src/hooks/usePushSubscription.ts @@ -224,6 +224,7 @@ export function usePushSubscription(): PushSubscriptionState { console.error('Push subscribe failed:', err); toast.error('Failed to enable push notifications', { description: err instanceof Error ? err.message : 'Check that notifications are allowed', + duration: 8_000, }); return null; } finally { diff --git a/frontend/src/test/usePushSubscription.test.ts b/frontend/src/test/usePushSubscription.test.ts index bfa4f5d..c387878 100644 --- a/frontend/src/test/usePushSubscription.test.ts +++ b/frontend/src/test/usePushSubscription.test.ts @@ -171,9 +171,12 @@ describe('usePushSubscription', () => { }); expect(result.current.loading).toBe(false); - expect(mocks.toast.error).toHaveBeenCalledWith('Failed to enable push notifications', { - description: expect.stringContaining('trusted TLS certificate for service workers'), - }); + expect(mocks.toast.error).toHaveBeenCalledWith( + 'Failed to enable push notifications', + expect.objectContaining({ + description: expect.stringContaining('trusted TLS certificate for service workers'), + }) + ); }, 5_000); it('recreates a stale browser subscription when the server VAPID key changed', async () => {