mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-01 18:23:03 +00:00
04fd1bfd0e
Pause and resume previously ran as independent, unsynchronised tasks: `pauseServices` stopped the sync and paused the client from a detached `Task`, while `resumeServices` resumed and started the sync directly. With no ordering between them, a late background pause could land after a foreground resume — leaving the client suspended and the sync stopped while the app was active, which broke everything until the next relaunch. Route both through a single serialised reconciler: each request records the desired state and chains onto the previous transition, and the reconcile always drives the SDK to the *latest* desired state. Transitions can no longer interleave and the most recent intent always wins. On deinit we no longer pause the client — it's being deallocated, so the SDK tears it down anyway; we just stop the sync and cancel the delegate.