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 646395 - WWAN section behaves strangely
WWAN section behaves strangely
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-03-31 23:48 UTC by Dan Williams
Modified: 2011-04-11 17:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot showing the problem (23.89 KB, image/png)
2011-03-31 23:49 UTC, Dan Williams
  Details
NetworkMenu: fix handling WWAN devices (1.83 KB, patch)
2011-04-02 20:32 UTC, Giovanni Campagna
committed Details | Review
two wwan devices (one CDMA, one GSM) (61.79 KB, image/png)
2011-04-06 19:25 UTC, Dan Williams
  Details

Description Dan Williams 2011-03-31 23:48:42 UTC
It seems like items aren't correctly cleaned out when things change.  If modem-manager dies or is restarted for some reason, you'll get a menu with a bunch of different widgets all over the place.  Same thing if the modem is enabled and disabled.  Not sure what's going on here, but nm-tool reports devices correctly so its likely a device tracking issue in the indicator.
Comment 1 Dan Williams 2011-03-31 23:49:15 UTC
Created attachment 184835 [details]
screenshot showing the problem
Comment 2 Dan Williams 2011-03-31 23:56:51 UTC
Furthermore, if the WWAN device is unplugged or otherwise removed, the menu removes the connections, but not the random status items that you see, and it still has a "Mobile Broadband" section even if NM doesn't expose any WWAN devices.
Comment 3 Dan Williams 2011-04-01 00:23:22 UTC
The additional items seem to be triggered by clicking the WWAN enable switch in the menu.  Due to an NM issue the device isn't getting enabled correctly, but it puts a string "invalid" at the bottom of the connection list.  When I unplug the modem, the WWAN section disappears, but when I replug it, the "invalid" item is still at the bottom of the list.  Is the code not throwing everything in the WWAN section away when there aren't any WWAN devices or something?
Comment 4 Giovanni Campagna 2011-04-02 20:32:24 UTC
Created attachment 184973 [details] [review]
NetworkMenu: fix handling WWAN devices

NMDeviceModem._createSection was not checking whether it should have
shown the connection list, resulting in status item shown even if
the device was in an invalid state.
Also, fix a logic error when creating the operatorItem and fix overriding
_clearSection protected method.

---

Bug 606074 has two other patches that may help here. Please test, because
my Nokia phone all of a sudden decided that it doesn't want to work.
Comment 5 Giovanni Campagna 2011-04-02 20:33:20 UTC
Bug 646074 I mean.
Comment 6 Dan Winship 2011-04-04 12:08:01 UTC
I haven't been able to reproduce this, with lots of playing around with connect, disconnect, plug in, unplug, kill, restart, etc. Can you give a better how-to-reproduce?
Comment 7 Dan Winship 2011-04-04 12:28:10 UTC
Comment on attachment 184973 [details] [review]
NetworkMenu: fix handling WWAN devices

>     _createSection: function() {
>+        if (!this._shouldShowConnectionList())
>+            return;

NMDeviceWired._createSection() doesn't have this check either, though I can't figure out if it matters.

>-            if (this.mobileDevice.operator_name)
>+            if (!this.mobileDevice.operator_name)
>                 this._operatorItem.actor.hide();

ugh! ok, that fixes the "mysterious blank signal strength entry when using cdma" bug. 

>-    clearSection: function() {
>+    _clearSection: function() {

and this is clearly correct
Comment 8 Dan Williams 2011-04-06 19:23:19 UTC
The WWAN menu doesn't handle multiple devices well.  The problem with that is that if you have more than one WWAN device, the whole section gets shown, but it muddles up the two devices.  Plus, when that happens, you can get invalid device states shown in the  menu, because the section is shown, but the device you just plugged in will initially be in "unmanaged" state and that translates to "invalid" in the network.js code.  Patch for device states forthcoming, but the problem is really that we need to handle multiple 3G devices better.

It's not a common use-case, but if you have a built-in 3G card that you no longer use (because say it's GSM and you switched to Verizon CDMA for work or something) and you have an external dongle that you do use, then this will happen.  Or, if you have a Bluetooth phone and an internal 3G card.  Or, if you bought the device with a built-in 3G card that uses bands for one network (AT&T for example) but does not support 3G on other networks (T-Mobile), and  thus you bought an external T-Mobile dongle, but you havent' taken apart the laptop to remove the original 3G card.

I think the current applet structure doesn't really work well for multiple devices of each type because it appears to be based on "sections", where we really do need to be based on the devices themselves.  Thus we run into problems where the current design doesn't properly separate devices from each other in the menu if you have more than one of a kind.

Separating on devices works well because if you *do* only have one of a kind, then the menu looks exactly like it does now and is not complicated.  But then if you ever plug in a second device, the device method can cope with it.

See the next screenshot for an example of two WWAN devices.  The devices aren't mentioned by name so you have no idea which device is which and which one can be used for what, for example.
Comment 9 Dan Williams 2011-04-06 19:25:44 UTC
Created attachment 185350 [details]
two wwan devices (one CDMA, one GSM)
Comment 10 Giovanni Campagna 2011-04-10 17:47:16 UTC
That's a duplicate of bug 646074
Comment 11 Dan Winship 2011-04-11 14:30:05 UTC
with all currently-pending patches, everything looks right with two wwan devices, except that the Mobile Broadband header still has a toggle switch.
Comment 12 Dan Winship 2011-04-11 14:45:35 UTC
Comment on attachment 184973 [details] [review]
NetworkMenu: fix handling WWAN devices

Attachment 184973 [details] pushed as c7dfd08 - NetworkMenu: fix handling WWAN devices
Comment 13 Giovanni Campagna 2011-04-11 16:19:26 UTC
(In reply to comment #11)
> with all currently-pending patches, everything looks right with two wwan
> devices, except that the Mobile Broadband header still has a toggle switch.

Which is right, because NetworkManager exposes a global "wwan-enable" property. (Docs describe it as something like airport mode but for WWAN only).
The fact that switching it has no effect is not a bug in the shell.
Comment 14 Dan Winship 2011-04-11 17:35:21 UTC
hm... ok, it seems weird, but if that's by design then everything here is fixed