Commit cd10cd7c authored by Michael Gratton's avatar Michael Gratton 🤞

Fix a deadlock when notifying engine of updated credentials

Don't restart a service when in the middle of propting for creds for it,
since if there's another auth error while restarting, the client won't
prompt again, and the service never resumes. Instead, restart at the end
when finished prompting.
parent a0fbf847
......@@ -793,12 +793,6 @@ public class GearyController : Geary.BaseObject {
yield libsecret.update_token(
account, creds_service, context.cancellable
);
// Update the engine using the original service
// however, since that is the one waiting for the
// credentials
yield this.application.engine.update_account_service(
account, service, context.cancellable
);
} catch (GLib.IOError.CANCELLED err) {
// all good
} catch (GLib.Error err) {
......@@ -819,7 +813,11 @@ public class GearyController : Geary.BaseObject {
context.authentication_prompting = false;
}
if (!handled) {
if (handled) {
yield this.application.engine.update_account_service(
account, service, context.cancellable
);
} else {
context.authentication_attempts = 0;
context.authentication_failed = true;
update_account_status();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment