robrix icon indicating copy to clipboard operation
robrix copied to clipboard

Handle app lifecycle events: `Pause`, `Resume`, etc

Open WaterWhisperer opened this issue 3 months ago • 1 comments

Description

Implements handling for app lifecycle events as requested in #458.

Changes

  • Added Event::Pause handler to save app state and stop sync service
  • Added Event::Resume/Event::Foreground handler to restore state and restart sync service
  • Added Event::Background handler for fallback state saving
  • Implemented redundancy tracking to avoid duplicate saves across lifecycle events

Testing

  • ✅ Code compiles without errors
  • ⚠️ Unable to test on iOS (no device available)

Fixes #458

WaterWhisperer avatar Oct 19 '25 04:10 WaterWhisperer

@kevinaboos Apologies for the delay in responding. Thank you for the detailed review and guidance. Since this is my first time working with app lifecycle events, it took me some time to fully understand your feedback and refactor the code. I've tested this on my Ubuntu 22.04 laptop (window minimize/restore cycles, shutdown/restart) and verified that state persistence works. Unfortunately I don't have access to a suitable mobile device to test the mobile behavior. Please let me know if there's anything else that needs adjustment. Thanks again for the thorough review!

WaterWhisperer avatar Nov 07 '25 09:11 WaterWhisperer