After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725905 - Defer loading user list until needed
Defer loading user list until needed
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-07 16:31 UTC by Florian Müllner
Modified: 2014-03-08 00:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
loginDialog: Add missing return value (909 bytes, patch)
2014-03-07 16:31 UTC, Florian Müllner
committed Details | Review
loginDialog: Defer loading user list until needed (2.97 KB, patch)
2014-03-07 16:32 UTC, Florian Müllner
none Details | Review
loginDialog: Defer loading user list until needed (2.97 KB, patch)
2014-03-07 16:35 UTC, Florian Müllner
reviewed Details | Review
loginDialog: Defer loading user list until needed (2.89 KB, patch)
2014-03-07 22:48 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-03-07 16:31:51 UTC
See patch.
Comment 1 Florian Müllner 2014-03-07 16:31:54 UTC
Created attachment 271246 [details] [review]
loginDialog: Add missing return value

_loadUserList() may be used as idle handler, so we should explicitly
return a boolean.
Comment 2 Florian Müllner 2014-03-07 16:32:01 UTC
Created attachment 271247 [details] [review]
loginDialog: Defer loading user list until needed

Loading the user list can be expensive, for instance when there is
a large number of users and/or their avatars have to be fetched over
the network. In case the user list is disabled anyway, there is no
point in doing that work just to hide it, so stop doing that.

foo
Comment 3 Florian Müllner 2014-03-07 16:35:19 UTC
Created attachment 271248 [details] [review]
loginDialog: Defer loading user list until needed

Whoops, fix commit message
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-03-07 16:39:29 UTC
Review of attachment 271246 [details] [review]:

OK.
Comment 5 Jasper St. Pierre (not reading bugmail) 2014-03-07 20:21:46 UTC
Review of attachment 271248 [details] [review]:

::: js/gdm/loginDialog.js
@@ +470,3 @@
         this._authPrompt.addActorToDefaultButtonWell(this._sessionMenuButton.actor);
 
+        this._disableUserList = undefined;

uh, what's the point of this?

@@ +477,3 @@
+        // focus later
+        Main.layoutManager.connect('startup-complete',
+                                   Lang.bind(this, this._updateDisableUserList));

I dislike that updateDisableUserList is the thing that "starts the user list". updateDisableUserList should simply update disableUserList. Although currently it also triggers the state machine again.

I've really never liked how the state machine here acts, held together with chicken wire and chewing gum, so sure, we can add a few more pieces of duct tape to it.

@@ +505,3 @@
+
+        if (!this._disableUserList)
+            this._queueLoadUserList();

Nothing will unqueue the load if we go from true-to-false while it's in-load, but perhaps that's OK.
Comment 6 Florian Müllner 2014-03-07 22:48:12 UTC
Created attachment 271280 [details] [review]
loginDialog: Defer loading user list until needed

(In reply to comment #5)
> +        this._disableUserList = undefined;
> 
> uh, what's the point of this?

The initial value must not match the setting or the state machine is never kicked off correctly. I'm sure we agree that this is extremely ugly, but it's simply how the code works currently - all the patch does is making it explicit.


> I dislike that updateDisableUserList is the thing that "starts the user list".
> updateDisableUserList should simply update disableUserList.

Except that something obviously needs to trigger a UI update to adapt to the setting :-)

But yeah, loading the list can be done elsewhere, moved.


> I've really never liked how the state machine here acts, held together with
> chicken wire and chewing gum, so sure, we can add a few more pieces of duct
> tape to it.

I don't think the patch makes anything worse, and this is clearly not the time for refactoring, so *shrug*


> @@ +505,3 @@
> +        if (!this._disableUserList)
> +            this._queueLoadUserList();
> 
> Nothing will unqueue the load if we go from true-to-false while it's in-load,
> but perhaps that's OK.

You mean false-to-true, but yeah, I don't see much of a problem there. It'd leave us with the same situation we have now, e.g. the list is loaded despite being hidden. A bit inefficient, but then I wouldn't expect the setting to change at all at runtime ...
Comment 7 Jasper St. Pierre (not reading bugmail) 2014-03-07 23:23:19 UTC
Review of attachment 271280 [details] [review]:

OK.
Comment 8 Florian Müllner 2014-03-07 23:32:30 UTC
Attachment 271246 [details] pushed as ef8123e - loginDialog: Add missing return value
Attachment 271280 [details] pushed as 0ba05b2 - loginDialog: Defer loading user list until needed
Comment 9 Jasper St. Pierre (not reading bugmail) 2014-03-08 00:38:12 UTC
( I actually started working on a large-scale gdm refactor today for the Wayland work, but I won't push it for 3.12: https://git.gnome.org/browse/gnome-shell/log/?h=wip/wayland-gdm-cleanup )