6e6a1e9c8a4d3d2d5522ae61860c32941c22b5da
pg_notify and the socket fan-out are not durable, so an offline phone used to miss a trigger forever and no-auto-stop would leave it ringing at nobody. Write one ledger row per enabled subscription in the trigger transaction, replay what a subscription still owes on every socket connect, and clear a row only on an explicit ack (live socket ack or ackAlarm); alarmStatus is a read-only check-in that answers 409 ERR_ALARM_TRIGGERED_OFFLINE with the missed frame. Ack is idempotent, and a destroyed alert cascades its debt away so a client is never told it missed an alarm that no longer exists.
Description
No description provided
214 KiB
Languages
Go
94.5%
PLpgSQL
3.4%
HTML
0.8%
Python
0.5%
Dockerfile
0.4%
Other
0.4%