mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-11 13:52:20 +00:00
setupWebhook now subscribes to appli=1 (weight + composition), appli=2 (temperature), and appli=4 (pressure family: BP, pulse, SpO2) in one pass. The previous implementation only registered appli=1, so a new BP reading from a BPM cuff sat for up to an hour waiting for the hourly poll fallback instead of arriving via push within seconds. A failure on one category is logged and we proceed with the rest — losing one webhook is strictly better than rolling back all three. The disconnect path mirrors the same iteration so cleanup unsubscribes every category we ever subscribed to. Webhook handler already dispatches `syncUserMeasurements` regardless of appli, so no change needed on the receiver side. Exports `WITHINGS_NOTIFY_APPLIS` as the single source of truth so the unit test and the disconnect route stay in lockstep with setupWebhook.