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 681146 - empty 3G dongle connection list (if gnome-shell is fully loaded before plug)
empty 3G dongle connection list (if gnome-shell is fully loaded before plug)
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: network-indicator
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-08-03 15:17 UTC by Pedro F.
Modified: 2015-05-10 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Plugged the pen (empty list presented) (4.75 KB, text/plain)
2012-08-03 15:17 UTC, Pedro F.
  Details
NetworkMenu: wait for capabilities before initializing modems (2.37 KB, patch)
2012-08-03 15:57 UTC, Giovanni Campagna
none Details | Review
NetworkMenu: look for capability changes in modems (4.40 KB, patch)
2012-08-03 16:24 UTC, Giovanni Campagna
none Details | Review
NetworkMenu: look for capability changes in modems (3.67 KB, patch)
2012-08-03 16:28 UTC, Giovanni Campagna
none Details | Review
xsession-errors (2.05 KB, text/plain)
2012-08-04 19:36 UTC, Pedro F.
  Details
NetworkMenu: look for capability changes in modems (4.27 KB, patch)
2012-08-06 13:16 UTC, Giovanni Campagna
none Details | Review

Description Pedro F. 2012-08-03 15:17:21 UTC
Created attachment 220252 [details]
Plugged the pen (empty list presented)

Description of problem:
Network applet forgets previously added 3G connections on Gnome-Shell, after unplugging the 3G dongle.

Version-Release number of selected component (if applicable):
Fedora 17's Gnome (gnome-shell-3.4.1) 

How reproducible:
Always.

Steps to Reproduce:
1. plug 3G dongle
2. add a new connection ( using nm-connection-editor )
3. connect to it
4. disconnect
5. unplug 3G dongle
6. plug it again

Actual results:
The previously created connection doesn't appear on the network applet's list

Expected results:
The previously created connection should appear on the network applet's list


Additional info:
1. If you disable the network applet ( mv /usr/share/gnome-shell/js/ui/status/network.js /usr/share/gnome-shell/js/ui/status/network.disabled [before loading the shell]), everything works.

2. using nm-connection-editor to change something on the connection (e.g., checking/unchecking "system connection" checkbox) makes it appear again on the list

3. Doing *just* ALT+F2, 'r' and consequently reloading gnome-shell also works: the previously configured connections will then appear. So the problem just happens if I plug the pen *after* gnome-shell is fully loaded.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-08-03 15:26:52 UTC
Comment on attachment 220252 [details]
Plugged the pen (empty list presented)

(We really need to fix Bugzilla to stop giving out obscure MIME types that no browser understands)
Comment 2 Giovanni Campagna 2012-08-03 15:42:30 UTC
Ok, so the way I read this is bug is that NM is first advertising a modem with no capabilities at all, and then adding GSM on top of it.
Since we only check connection validity when we create the NMDevice wrapper, initially no connection can be applied to this device.

I'm not sure it's right for NM to do so, but probably it is because of some issue down the stack, so we should work around it here.
Comment 3 Giovanni Campagna 2012-08-03 15:57:15 UTC
Created attachment 220257 [details] [review]
NetworkMenu: wait for capabilities before initializing modems

Hotplugged modems may be introduced on the bus with no capabilities,
in which case the shell would show nothing for them. Instead, wait
for the capabilities to appear, and only create the UI at that point.

NOT TESTED, for lack of appropriate hardware.
Please test and report if this fixes your bug.
Comment 4 Giovanni Campagna 2012-08-03 16:24:18 UTC
Created attachment 220262 [details] [review]
NetworkMenu: look for capability changes in modems

Some modems can switch between CDMA and GSM without a full restart,
and some may initially appear to have no capability at all, and only
acquire some after some time.
Comment 5 Dan Williams 2012-08-03 16:28:30 UTC
So modems can actually change capabilities on the fly these days, specifically with "global mode" devices like the Pantech UML190, UM290, Gobi devices, and quite a few phones can too.  So we do need to handle switches from CDMA <-> GSM and update the connection list with applicable connections when that happens.

(in the near future, with MM 0.7/0.8, some devices are capable of CDMA and GSM at the same time, so we'll need some updates to the Shell code that talks to MM to  handle that, but that's not immediately necessary)
Comment 6 Giovanni Campagna 2012-08-03 16:28:43 UTC
Created attachment 220264 [details] [review]
NetworkMenu: look for capability changes in modems

Some modems can switch between CDMA and GSM without a full restart,
and some may initially appear to have no capability at all, and only
acquire some after some time.
Comment 7 Pedro F. 2012-08-03 17:04:51 UTC
Attachment 220264 [details] applied successfully to Fedora 17's Gnome (gnome-shell-3.4.1) but yields no section called "Mobile broadband" after device settled. Furthermore, after gnome-shell alt-f2 'r' restart, with device plugged in, it seems to be deleting the "Wireless" and "Wired" section (and still no "Mobile broadband").
Comment 8 Pedro F. 2012-08-04 19:36:30 UTC
Created attachment 220324 [details]
xsession-errors

JS ERROR: !!!   Exception was: ReferenceError: device is not defined
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-08-04 19:39:56 UTC
That's because the patch that Giovanni made is broken.
Comment 10 Giovanni Campagna 2012-08-06 13:16:44 UTC
Created attachment 220437 [details] [review]
NetworkMenu: look for capability changes in modems

Some modems can switch between CDMA and GSM without a full restart,
and some may initially appear to have no capability at all, and only
acquire some after some time.

Is this one better?
Comment 11 Pedro F. 2012-08-08 11:43:15 UTC
Yes, working fine now :)
Three minor bugs though:
1) if I keep the network menu open while plugging the pen, when the 'mobile broadband' appears there is a missing separator between that section and 'wireless'; it shows fine after reclicking the network icon.
2) similarly, if unplugging the pen while keeping the network menu open, there is an extra separator between 'wireless' and 'vpn connections'; once again it shows fine after reclicking the network icon.
3) clicking a mobile connection doesn't toggle the mobile broadband on/off switch, which means to disconnect I've to click on it to set it 'on' and finally I can click on it to set it 'off' which will then trigger the disconnection; either clicking a network should set it to 'on' or the networks shouldn't be shown if it is set to 'off'.
Comment 12 Jon Dowland 2012-09-07 17:26:12 UTC
Sadly this patch has not cured the issue for me.
Comment 13 Giovanni Campagna 2012-10-18 20:16:13 UTC
Anyone up for a review?
Comment 14 Aleksander Morgado 2012-11-20 08:59:18 UTC
I would note that changing from CDMA to GSM and viceversa on the fly is not really supported yet by any ModemManager, but it may happen in the future. Also, the new ModemManager >= 0.7 won't export modems in DBus without capabilities.

I'll review the patch and test it with my modems later. Also, I'll rework the patch for bugs 687359 and 688144 once this one is applied.
Comment 15 Aleksander Morgado 2012-11-21 16:05:02 UTC
I've been testing this with or without the patch and couldn't really reproduce the original issue.

What I've seen, though, is that with the patch we end up reloading the connections lots of times, as the current-capabilities seems to be notified multiple times with the same exact value. E.g.: These logs show the sequence just when the modem gets enabled:
       JS LOG: Capabilities for /org/freedesktop/ModemManager/Modems/6 changed; updating list of connections
      JS LOG: Modem /org/freedesktop/ModemManager/Modems/6 is GSM/UMTS
      JS LOG: Capabilities for /org/freedesktop/ModemManager/Modems/6 changed; updating list of connections
      JS LOG: Modem /org/freedesktop/ModemManager/Modems/6 is GSM/UMTS
      JS LOG: Capabilities for /org/freedesktop/ModemManager/Modems/6 changed; updating list of connections
      JS LOG: Modem /org/freedesktop/ModemManager/Modems/6 is GSM/UMTS
      JS LOG: Capabilities for /org/freedesktop/ModemManager/Modems/6 changed; updating list of connections
      JS LOG: Modem /org/freedesktop/ModemManager/Modems/6 is GSM/UMTS

So we end up reloading the list 4 times here. I opened a bug for this in NM, see bug 688817.
Comment 16 Pedro F. 2012-11-27 06:42:00 UTC
You're right it works now without the patch, though it shouldn't, since here ModemManager < 0.7 ...

gnome-shell-3.4.1-6.fc17.i686
NetworkManager-0.9.6.4-3.fc17.i686
ModemManager-0.6.0.0-1.fc17.i686
Comment 17 Aleksander Morgado 2012-11-27 10:36:11 UTC
Actually, my comment about MM >= 0.7 wasn't appropriate. The capabilities here are exposed by NetworkManager NMDevices, MM has nothing to do with this behaviour.
Comment 18 Pedro F. 2015-05-10 11:22:35 UTC
stopped using 3G dongles and no-one else had the same issue.