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 659277 - Indicator stuck "connecting" after resume from sleep
Indicator stuck "connecting" after resume from sleep
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 661094 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-16 18:02 UTC by Cosimo Cecchi
Modified: 2011-11-03 12:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Network Menu: fix pulling out the first element from the More... submenu. (2.25 KB, patch)
2011-10-17 12:49 UTC, Giovanni Campagna
reviewed Details | Review
Network Menu: fix pulling out the first element from the More... submenu. (2.79 KB, patch)
2011-10-26 15:52 UTC, Giovanni Campagna
needs-work Details | Review
Network Menu: fix pulling out the first element from the More... submenu. (3.56 KB, patch)
2011-10-29 10:32 UTC, Giovanni Campagna
committed Details | Review

Description Cosimo Cecchi 2011-09-16 18:02:32 UTC
Not sure if this is specific to suspend/resume, but that's the situation where I often reproduce it.

- suspend your laptop and resume
- it will reconnect to the network
- connection goes fine, and I can browse the web, but the shell indicator still shows the "Connecting" icon

Restarting the shell with "Alt+F2 r" restores the indicator to the normal state.
Comment 1 Cosimo Cecchi 2011-09-20 16:41:09 UTC
Wonder if this is a duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=658150
Comment 2 Cosimo Cecchi 2011-10-05 18:15:52 UTC
Okay, I hit this again;

Some info from ~/.xsession-errors:

I see this:

    JS ERROR: !!!   Exception was: TypeError: apObj is null
    JS ERROR: !!!     lineNumber = '1306'
    JS ERROR: !!!     fileName = '"/usr/share/gnome-shell/js/ui/status/network.js"'
    JS ERROR: !!!     stack = '"([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/usr/share/gnome-shell/js/ui/status/network.js:1306
"'
    JS ERROR: !!!     message = '"apObj is null"'

Then later this happens:

Window manager warning: Log level 16: _nm_object_get_property: Error getting 'Ssid' for /org/freedesktop/NetworkManager/AccessPoint/285: (19) Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

    JS ERROR: !!!   Exception was: Error: Expected type guint8 for Argument 'ssid' but got type 'object' (nil)
    JS ERROR: !!!     lineNumber = '0'
    JS ERROR: !!!     fileName = '"gjs_throw"'
    JS ERROR: !!!     stack = '"("Expected type guint8 for Argument 'ssid' but got type 'object' (nil)")@gjs_throw:0
ssidToLabel(null)@/usr/share/gnome-shell/js/ui/status/network.js:95
([object Array])@/usr/share/gnome-shell/js/ui/status/network.js:116
NMNetworkMenuItem([object Array])@/usr/share/gnome-shell/js/ui/status/network.js:102
([object Object],1)@/usr/share/gnome-shell/js/ui/status/network.js:1502
()@/usr/share/gnome-shell/js/ui/status/network.js:1547
([object _private_NMClient_DeviceWifi],30,20,42)@/usr/share/gnome-shell/js/ui/status/network.js:634
"'
    JS ERROR: !!!     message = '"Expected type guint8 for Argument 'ssid' but got type 'object' (nil)"'
Comment 3 Giovanni Campagna 2011-10-17 12:49:40 UTC
Created attachment 199197 [details] [review]
Network Menu: fix pulling out the first element from the More... submenu.

PopupMenu.firstMenuItem returns a PopupMenuItem, not an apObj. We
need to retrive the latter using the back property.

Also, somehow the property from the number of elements in a menu
was changed from .length to .numMenuItems, and this broke the
destruction of the menu upon emptying it.
Comment 4 Giovanni Campagna 2011-10-17 12:53:10 UTC
Not a fix for the original bug (the connected/connecting status should originate from a different C signal handler, and thus should not be affected by JS exceptions), but should definitely help.

Also, for the "Window manager warning" part, see bug 651378 comment #27.
Comment 5 Cosimo Cecchi 2011-10-24 22:31:02 UTC
*** Bug 661094 has been marked as a duplicate of this bug. ***
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-10-26 14:48:37 UTC
Review of attachment 199197 [details] [review]:

::: js/ui/status/network.js
@@ +1304,3 @@
 
+                    let item = this._overflowItem.menu.firstMenuItem;
+                    if (item && item._apObj) {

Not a fan of accessing another item's private property.

@@ +1317,3 @@
                 // This can happen if the removed connection is from the overflow
                 // menu, or if we just moved the last connection out from the menu
+                if (this._overflowItem.menu.numMenuItems == 0) {

This looks unrelated?
Comment 7 Giovanni Campagna 2011-10-26 15:52:14 UTC
(In reply to comment #6)
> Review of attachment 199197 [details] [review]:
> 
> ::: js/ui/status/network.js
> @@ +1304,3 @@
> 
> +                    let item = this._overflowItem.menu.firstMenuItem;
> +                    if (item && item._apObj) {
> 
> Not a fan of accessing another item's private property.

Not a private property, it's a property NMDeviceWifi attaches in _createNetworkItem... sometimes.
I'll attach a patch for that as well :)

> 
> @@ +1317,3 @@
>                  // This can happen if the removed connection is from the
> overflow
>                  // menu, or if we just moved the last connection out from the
> menu
> +                if (this._overflowItem.menu.numMenuItems == 0) {
> 
> This looks unrelated?

Not really. I guess the menu can end up empty because of that, and therefore crash the next time, three lines up.
Comment 8 Giovanni Campagna 2011-10-26 15:52:30 UTC
Created attachment 200035 [details] [review]
Network Menu: fix pulling out the first element from the More... submenu.

PopupMenu.firstMenuItem returns a PopupMenuItem, not an apObj. We
need to retrive the latter using the back property.

Also, somehow the property from the number of elements in a menu
was changed from .length to .numMenuItems, and this broke the
destruction of the menu upon emptying it.
Comment 9 Jasper St. Pierre (not reading bugmail) 2011-10-29 01:14:50 UTC
Review of attachment 200035 [details] [review]:

"the back property?"

Otherwise, this looks fine.

::: js/ui/status/network.js
@@ +1497,2 @@
                 apObj.item = this._createAPItem(apObj.connections[0], apObj, false);
+                apObj.item._apObj = apObj;

Put this below the if, instead of duplicating it in both branches?
Comment 10 Giovanni Campagna 2011-10-29 10:31:02 UTC
(In reply to comment #9)
> Review of attachment 200035 [details] [review]:
> 
> "the back property?"

Uhm... like "back pointer"? Changed, anyway.
Comment 11 Giovanni Campagna 2011-10-29 10:32:17 UTC
Created attachment 200240 [details] [review]
Network Menu: fix pulling out the first element from the More... submenu.

PopupMenu.firstMenuItem returns a PopupMenuItem, not an apObj. We
need to retrive the latter using the _apObj property.

Also, somehow the property from the number of elements in a menu
was changed from .length to .numMenuItems, and this broke the
destruction of the menu upon emptying it.
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-10-29 14:20:50 UTC
Review of attachment 200240 [details] [review]:

Makes sense to me.
Comment 13 Giovanni Campagna 2011-11-03 12:13:00 UTC
Attachment 200240 [details] pushed as 70fc135 - Network Menu: fix pulling out the first element from the More... submenu.