mirror of
https://github.com/bulwarkmail/native.git
synced 2026-10-31 16:06:32 +00:00
The previous fix started the refresh as the app went to the background, but it still stopped after its first request: fetch hands every response over through a JS timer, and React Native pauses timers while the app's activity is in the background, so the answer was only read once the app came back. The widgets kept the previous account after a switch and Home, and changes made in the app reached them late. The refresh now runs as a headless task of its own, BulwarkWidgetRefresh, started through BulwarkWidgetRefreshService. A running headless task keeps the timers going, and the service keeps the process from being frozen before the widgets are redrawn. Where Android refuses to start the service the app refreshes in place as before. A refresh started for a change also no longer joins one that began before it.