Improve GNOME Online Accounts error handling
GNOME Online Accounts can encounter several problems which can have a flow-on effect for Geary, including:
- OAuth2 token has expired, requiring people open Online Accounts in Settings and log in again
- OAuth2 token requires refreshing, which can take some time (up to 30s?) to do
- Various network problems can cause any of the above to go wrong (host not found, TLS certificate errors, etc)
There's a few concrete things to be done here:
-
Per GOA docs, retry calling EnsureCredentials
if that fails with an auth error -
Listen to Goa.Account.attention_needed
and show/hide an an infobar that will open the account in GNOME Settings, and importantly suppress any connection errors for that account while that property is true. -
Provide some feedback if possible when token is being refreshed
We should also work out how GOA reports errors such as host not found and ensure these are handled appropriately.