push: return the device id and badge the alert !450

merged merged by cmc on 2026-09-20 22:46 UTC · krz/gitbay:push-device-id-badge into main

Discussion

cmc

The iOS push work needs two things the shipped feature does not provide: deregistration needs the device row id, and the app icon needs a badge count.

  • notifications device add now returns the row id AddPushDevice already had, instead of discarding it. A client that wants to deregister previously had to list devices and match its own token against the truncated display value.
  • DuePush now counts the recipient's unread inbox rows in a subquery and carries it as QueuedPush.Badge. Counted at send time rather than at enqueue, so an inbox cleared in the seconds before delivery is reflected. Send gains a badge int parameter (after user) and puts it in aps.badge.

No schema change, no new Go module dependency.

Ref #89