From 7a09a948a6435af00783c0e44582333600a792b3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 20 Feb 2023 14:32:52 -0500 Subject: goakerberosidentity: Queue is-signed-in notify before emitting expired signal Right now the "expired" signal is emitted before the "is-signed-in" property notification is queued. This notification is used to update the "IsSignedIn" property of the object on the bus. The "expired" signal emission leads to a corresponding "identity-expired" signal on the manager object. A handler for that signal calls into gnome-online-accounts to check identity status. In response, gnome-online-accounts will check the "IsSignedIn" property. This commit makes sure the "is-signed-in" notification is queued first, before the "expired" signal is emitted. Of course queuing the notify before "expired" is emitted isn't enough to ensure the notify happens in time. A future commit will make sure the "identity-expired" signal itself is deferred to the main thread, which should resolve that problem. --- src/goaidentity/goakerberosidentity.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/goaidentity/goakerberosidentity.c b/src/goaidentity/goakerberosidentity.c index de646d5..0eb0a9c 100644 --- a/src/goaidentity/goakerberosidentity.c +++ b/src/goaidentity/goakerberosidentity.c @@ -1055,31 +1055,21 @@ out: if (best_verification_level != old_verification_level) { + G_LOCK (identity_lock); + self->cached_verification_level = best_verification_level; + queue_notify (self, &self->is_signed_in_idle_id, "is-signed-in"); + G_UNLOCK (identity_lock); + if (old_verification_level == VERIFICATION_LEVEL_SIGNED_IN && best_verification_level == VERIFICATION_LEVEL_EXISTS) { - G_LOCK (identity_lock); - self->cached_verification_level = best_verification_level; - G_UNLOCK (identity_lock); - g_signal_emit (G_OBJECT (self), signals[EXPIRED], 0); } else if (old_verification_level == VERIFICATION_LEVEL_EXISTS && best_verification_level == VERIFICATION_LEVEL_SIGNED_IN) { - G_LOCK (identity_lock); - self->cached_verification_level = best_verification_level; - G_UNLOCK (identity_lock); - g_signal_emit (G_OBJECT (self), signals[UNEXPIRED], 0); } - else - { - G_LOCK (identity_lock); - self->cached_verification_level = best_verification_level; - G_UNLOCK (identity_lock); - } - queue_notify (self, &self->is_signed_in_idle_id, "is-signed-in"); } default_principal = get_default_principal (self); -- cgit v1.2.1