feat: disable background io per account, available apis in rust and jsonrpc
api: rust: add set_disable_background_io and get_disable_background_io to a Accounts (the account manager)
api: jsonrpc: add set_disable_background_io method and Account::Configured.background_io_disabled property
api: select account now starts and stops io for "background disabled" accounts
This is partly a port of the desktop "disable sync all" option, the other part is making it per account. So you can define that an account should be excluded from background syncing. Using this will remove the start/stop io call code complexity from desktop.
This will be useful for advanced users that want to control their network traffic: Do not connect to a specific email account in the background unless it is actively selected:
- like when the network is monitored and you want to hide your other accounts by disabling their background syncing.
- or when you want to keep old accounts that have broken credentials (if the provider went down or your account got deleted) and want to save background traffic that would be wasted in trying to connect, but just getting errors
References:
- desktop pr: TODO
TODO:
- [ ] desktop pr
- [ ] test it
- [ ] maybe: writing integration tests?
- [ ] maybe: cffi api
- [ ] discuss it with bjoern, link2xt and others
- [ ] make sure it's respected in the background fetch method. (Accounts::background_fetch)
Note that this feature for earliest 1.45, so not priority currently.
Closes #4296