mirror of
https://github.com/logos-messaging/logos-delivery-go.git
synced 2026-07-01 02:29:47 +00:00
Adds backgroundMode to Sub and SetBackgroundMode(bool) to both Sub and FilterManager. When background=true, subscriptionLoop skips the 5-second health-check ticker and drops expired subscription IDs from the closing channel without resubscribing. When background=false (foreground return), a resubscription is immediately triggered for any expired filters. Background context (status-im/status-app#21045): On Android, each Waku filter subscription has a relay-side TTL (~13.5 min observed). When it expires, the closing channel fires, checkAndResubscribe runs, and a new wf.Subscribe() RPC wakes the LTE modem. With a loaded account this happens every ~13.5 min overnight, producing a 55% radio duty cycle (~144 mAh/hr) while the screen is locked. With background mode active, no network I/O occurs during subscription expiry. On foreground return, all expired filters are resubscribed in one burst — the user sees a brief reconnect, then full message delivery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>