[BTAPI-74] Support disabling push notifications per device #89

Merged
chris merged 4 commits from feature/BTAPI-74 into main 2026-09-03 09:58:56 -06:00
Owner

Ticket

BTAPI-74 Support disabling push notifications per device

Summary

  • Adds notificationsEnabled?: boolean to the Device model, distinct from the existing disabled (stale-token) flag.
  • DeviceService.upsert() only sets notificationsEnabled when the caller explicitly provides it, so plain token-registration calls don't reset a user's opt-out.
  • POST /device accepts an optional notificationsEnabled flag to let the app set the toggle for its own token.
  • Notifications.dispatch filters opted-out devices out of the fan-out for send/sendRevision. sendAlert (operational alerts: dead session, failing sync) is explicitly exempt via { respectOptOut: false } and keeps reaching every registered device.
  • New/updated tests across server/lib/data/device, server/api/routes/device, and server/lib/notifications; root CLAUDE.md updated for the new field and route behavior.
## Ticket [BTAPI-74](http://192.168.2.100:7123/home/browse/BTAPI-74/) Support disabling push notifications per device ## Summary - Adds `notificationsEnabled?: boolean` to the `Device` model, distinct from the existing `disabled` (stale-token) flag. - `DeviceService.upsert()` only sets `notificationsEnabled` when the caller explicitly provides it, so plain token-registration calls don't reset a user's opt-out. - `POST /device` accepts an optional `notificationsEnabled` flag to let the app set the toggle for its own token. - `Notifications.dispatch` filters opted-out devices out of the fan-out for `send`/`sendRevision`. `sendAlert` (operational alerts: dead session, failing sync) is explicitly exempt via `{ respectOptOut: false }` and keeps reaching every registered device. - New/updated tests across `server/lib/data/device`, `server/api/routes/device`, and `server/lib/notifications`; root `CLAUDE.md` updated for the new field and route behavior.
chris merged commit 3b1c889b26 into main 2026-09-03 09:58:56 -06:00
chris deleted branch feature/BTAPI-74 2026-09-03 09:58:56 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chris/budget-tracker!89
No description provided.