Skip to content

v0.3.2 - Fix desktop notification reliability

Choose a tag to compare

@andybochmann andybochmann released this 16 Feb 19:24
· 107 commits to main since this release

What's Fixed

Desktop notifications now work reliably

The notification system had several bugs causing silent failures:

  1. Auto-create missing preferences — Users without a NotificationPreference record (anyone who hadn't visited settings) had ALL notifications silently skipped. The worker now auto-creates default preference records so notifications work out of the box.

  2. Error logging — All silent .catch(() => {}) blocks replaced with console.error logging across the notification pipeline (worker, task routes, preferences). Failures are now visible in server logs.

  3. End-to-end push test — New "Test Push Notification (Server)" button in notification settings sends a real push through the server pipeline to ALL registered devices. Useful for verifying cross-device delivery.

  4. VAPID key validation — Server now logs a clear warning on startup when VAPID keys are missing, instead of silently disabling push.

Docker build fix

  1. TypeScript narrowing error — Fixed session.user possibly-undefined error in notification preferences PATCH handler that broke docker build. Extracted session.user.id into a local variable before the async callback.

Files Changed

  • src/lib/notification-worker.ts — Auto-create preferences, error logging
  • src/app/api/push/test/route.ts — New test push endpoint
  • src/app/api/notifications/preferences/route.ts — Fix TS narrowing for Docker build
  • src/components/settings/notification-settings-card.tsx — Dual test buttons
  • src/instrumentation.ts — VAPID validation logging
  • Task route handlers — Error logging for reminder scheduling

Testing

  • 1539/1539 tests passing
  • 6 new tests added (3 for missing prefs, 3 for push test endpoint)
  • Docker build verified