Commit graph

14 commits

Author SHA1 Message Date
Michael Gratton
de8c3858e9 Convert key classes to implement Loggable
Make accounts, folders, client sessions and account ops implement
Loggable, remove manual context from log messages there and in
subclasses.
2019-06-30 16:14:50 +10:00
Michael Gratton
085518a65c Don't prompt for passwords from deep within the engine
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.
2019-03-06 22:46:56 +11:00
Michael Gratton
82160e9ff4 Fix GOA accounts throwing an error when starting offline
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.
2019-03-03 22:20:41 +11:00
Michael Gratton
e286e9dea6 Throw errors when IMAP or SMTP services have incomplete creds
Instead of just flagging the state, it means the error gets handled
correctly at a higher level.
2019-02-21 15:41:51 +11:00
Michael Gratton
eb1aa4c31f Ensure IMAP and SMTP services notify of auth failure if creds incomplete
This avoids attemting to connect and login when we know it is going to
fail.
2019-02-21 14:26:29 +11:00
Michael Gratton
a08cecad7b Make public I/O methods in Imap.Client require cancellables
Explicit is better than implcit. Fix a few places where it wasn't being
passed in, resulting in some criticals when accounts have gone away.
2019-02-10 22:47:32 +11:00
Michael Gratton
018f700d0d Fix unhandled error warning, tidy up error handling 2019-01-10 23:09:36 +11:00
Michael Gratton
0d93696d6c Don't update status for IMAP connection problems multiple times
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.
2019-01-09 15:22:19 +11:00
Michael Gratton
92353bf0c9 Add Geary.ErrorContext class for passing rich error context info around
Require ClientService implementations and ProblemReport use contexts
rather than bare errors. Move code for generating backtraces and and
formatting errors from ProblemReport to ErrorContext.
2019-01-07 22:10:34 +11:00
Michael Gratton
20a53f2d51 Rework how auth failures are propagated by the IMAP stack
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.
2019-01-01 22:29:07 +11:00
Michael Gratton
a637a6b63a Remove auth failure prompting from the engine
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.
2019-01-01 22:29:07 +11:00
Michael Gratton
827db39fe2 Provide common service status tracking via ClientService
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.
2019-01-01 22:29:07 +11:00
Michael Gratton
95ebdd65d2 Tidy up ClientService API a bit
Require endpoint to always be present so it is never null, and hence
passed in through account creation. Rename props to be a bit more
descriptive.
2018-12-27 10:20:58 +10:30
Michael Gratton
62c90e40db Implement ClientService for IMAP (2/3)
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)