GNOME Bugzilla – Bug 681146
empty 3G dongle connection list (if gnome-shell is fully loaded before plug)
Last modified: 2015-05-10 11:22:35 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 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)
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.
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.
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.
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)
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.
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").
Created attachment 220324 [details] xsession-errors JS ERROR: !!! Exception was: ReferenceError: device is not defined
That's because the patch that Giovanni made is broken.
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?
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'.
Sadly this patch has not cured the issue for me.
Anyone up for a review?
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.
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.
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
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.
stopped using 3G dongles and no-one else had the same issue.