Files
LibreMail/app
JMR-devandClaude Opus 4.8 1d918cdd75 Stop an account's IDLE watcher when the account is removed
IdleService read the account list once at startup, so a removed account's IDLE
loop kept reconnecting (backing off harmlessly) until the service restarted, and a
newly-added account wasn't watched until then either.

- IdleService now observes the accounts and reconciles one IDLE watcher per account:
  it starts a watcher for an added account and cancels the watcher for a removed one,
  which closes that account's IDLE connection promptly via the existing cancellation
  path.
- The app runs the service only while push is enabled AND at least one account exists,
  so it auto-starts on the first account and stops on the last.
- Verified on the Android 17 emulator: two accounts held two IDLE connections; removing
  one dropped to a single connection with no retry loop, and the other kept idling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 15:09:27 -05:00
..