Skip to content

[relay] Coalesce/debounce APNs silent-push wakes to respect the ~5/day budget #76

@pvg13

Description

@pvg13

Context

APNs throttles silent (content-available) pushes to roughly 5 per device per day and coalesces bursts; beyond that they are deferred or dropped. If the relay maps writes→pushes 1:1, wakes silently stop arriving and background sync dies on iOS.

Task

Relay-side debounce / coalesce of wake pushes per (device, topic):

  • Collapse a burst of writes into a single wake push.
  • Rate-limit per device/day toward the budget.
  • Treat the push as a best-effort wake hint — the peer reconnects and the version-vector catch-up delivers the actual data, so a dropped/coalesced push only delays, never loses, sync.

Targeted multi-group wake already narrows which device gets woken; this adds the rate control on top.

Acceptance

  • Under sustained writes, per-device silent pushes stay within budget.
  • Instrument actual pushes/device/day to confirm.

References

  • Gap P1-5 / §2.2 in docs/research/ios-sync-state-of-the-art.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:highSignificant bug, common path affectedtopic:relaywavesync_relay server and circuit relay

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions