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 646355 - Cope better with invalid or unsupported connections
Cope better with invalid or unsupported connections
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 15:50 UTC by Giovanni Campagna
Modified: 2011-04-03 12:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
NetworkStatus: ignore broken connections (1.26 KB, patch)
2011-03-31 15:51 UTC, Giovanni Campagna
reviewed Details | Review
NetworkStatus: ignore broken and unsupported connections (2.47 KB, patch)
2011-03-31 17:02 UTC, Giovanni Campagna
reviewed Details | Review
NetworkStatus: ignore invalid and unsupported connection types (2.72 KB, patch)
2011-04-02 17:17 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2011-03-31 15:50:51 UTC
Currently connections that are of unsupported type (like wimax, or like those emitted by NM up until NetworkManager/b8a1a3864005307929632d77575bcde92b3354c5) throw exceptions that cause the menu to end up completely emtpy.
Instead, those should be handled before throwing (and eventually supported, but that's after 3.2).
Comment 1 Giovanni Campagna 2011-03-31 15:51:13 UTC
Created attachment 184796 [details] [review]
NetworkStatus: ignore broken connections

Sometimes NetworkManager sends connections that have invalid settings.
This should not happen, but in case it does, we should not blow up,
but just log a warning and continue silently.
Comment 2 Dan Winship 2011-03-31 16:31:44 UTC
Comment on attachment 184796 [details] [review]
NetworkStatus: ignore broken connections

do we need to remove the connection from _connections in this case? Otherwise, it seems like weird things could happen; eg, places that check this._connections.length might do the wrong thing.
Comment 3 Giovanni Campagna 2011-03-31 17:02:33 UTC
Created attachment 184803 [details] [review]
NetworkStatus: ignore broken and unsupported connections

Sometimes NetworkManager sends connections that have invalid settings.
This should not happen, but in case it does, we should not blow up,
but just log a warning and continue silently. Also, some connection
types (like wimax) are just not supported by the menu, and should be
ignored as well.

Updated patch. I think that we need to continue tracking all connections
in _connections and _updateConnection, because _syncActiveConnection will
retrieve the connection directly from libnm-glib and code wants _name, _type,
_section and _uuid to be always present and valid.
Comment 4 Dan Winship 2011-04-01 14:57:04 UTC
Comment on attachment 184803 [details] [review]
NetworkStatus: ignore broken and unsupported connections

cool, much simpler.

You still need to disconnect the signal handlers in _connectionRemoved though I think?
Comment 5 Dan Williams 2011-04-01 16:52:17 UTC
If you don't mind, could you update the patch description to say "invalid or unsupported", since stuff like wimax or pppoe certainly isn't valid, but is currently unsupported by the indicator.
Comment 6 Owen Taylor 2011-04-01 21:21:27 UTC
Review of attachment 184803 [details] [review]:

Agree with danw that you are missing the signal connection removal (though I don't think that will cause any actual problems), otherwise looks OK to me.
Comment 7 Giovanni Campagna 2011-04-02 17:17:20 UTC
Created attachment 184953 [details] [review]
NetworkStatus: ignore invalid and unsupported connection types

Some connection types (like wimax) are not supported by the menu, and
should be ignored instead of throwing exceptions. Also, NetworkManager
had a bug that sent connections with invalid settings. This should not
happen, but in case it does, we will not blow up, but just log a warning
and continue silently.
Comment 8 Owen Taylor 2011-04-03 01:53:06 UTC
Review of attachment 184953 [details] [review]:

Patch looks right to me. Tested by hacking the code to make VPN an unrecognized type and without the patch, empty menu (Network Setttings only) and with the patch came up correctly just without the VPN connections. Good pending R-T approval.
Comment 9 Giovanni Campagna 2011-04-03 12:25:27 UTC
Attachment 184953 [details] pushed as 20f1457 - NetworkStatus: ignore invalid and unsupported connection types