mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
Two structural changes on the notification platform that unblock the mood-reminder ledger-after-delivery semantics (separate commit) and close the v0.5.4 PR #190 review's Security-H1 finding. - `dispatchNotification` now returns `DispatchOutcome` with `dispatched`, `channelsAttempted`, and `channelsSucceeded`. The caller can decide whether the send is worth marking as committed in its own ledger. Existing callers that ignore the return value keep working — the function is still best-effort and never throws. - `sendViaApns` now whitelists the metadata keys it forwards into the APNs custom payload. The dispatcher's `metadata` is shared across every channel and previously surfaced channel-specific payload structures (Telegram's `replyMarkup` keyboard, ad-hoc extras) into the APNs userInfo Apple sees and the iOS app's notification handler. The allowlist covers the keys iOS actually reads (`scheduledAt`, `localDate`, `medicationId`, `scheduleId`, `phase`, `date`) and drops the rest.