The fix for !161 moved updating credentials to reasonably deep within
the IMAP service to fix some poor behaviour for GOA accounts, however
local accounts would still prompt for a password if not present in
libsecret from there, and if cancelled would prompt as many times as the
service attempted to re-open the pool.
This removes the call to prompt for a password from the libsecret
mediator, brings back some of the API removed by commit c8f5e029, so
that services can tell if credentials weren't loaded, and hence notify
appropriately so the controller can then do the prompting.
Don't check service credentials are loaded when the account is being
opened, since GOA accounts will do a
org.gnome.OnlineAccounts.Account::EnsureCredentials() call, and this
will error out if the creds are invalid or not available.
Instead, check when we know that the services should be reachable, and
hope that means the GOA provider's auth service is reachable, too.
This moves connection error notification in ImapClientService to one
place, so status updates and errors are only reported once, and the
correct status changes are made. This fixes TLS cert problems both
being reported as such, and as a service problem.
Require ClientService implementations and ProblemReport use contexts
rather than bare errors. Move code for generating backtraces and and
formatting errors from ProblemReport to ErrorContext.
Rather than using cascading signals to indicate an auth error, have
ImapClientSession throw an appropriate exception, and catch that as
needed in ImapClientService and the Engine's validation code.
Add a signal to AccountInformation for notifying the client that an
auth failure has occurred, and remove code for prompting the user from
both IMAP and SMTP services. This means the same mechanism is used for
both for handling this and untrusted hosts, and allows the client to
implement desired policy, e.g. saving passwords and number of prompts to
retry.
This adds a `current_status` property to ClientService to track the
service's operational state, wich can be monitored by both the engine
and clients for changes. Hook up subclasses to keep that update, and
move connectivity management in to ClientService to provide a common
implementation.
Rename ClientSessionManager to ClientService, make it extend Geary.ClientService and implement
its signauture. Use this as GenericAccount's incoming client service.
Part two of a three part series.
2018-11-30 23:49:30 +11:00
Renamed from src/engine/imap/transport/imap-client-session-manager.vala (Browse further)