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 688379 - (regression) gnome-shell doesn't re-register NetworkAgent when NetworkManager is restarted
(regression) gnome-shell doesn't re-register NetworkAgent when NetworkManager...
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-15 10:42 UTC by Aleksander Morgado
Modified: 2012-11-20 13:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for the issue. (1.13 KB, patch)
2012-11-15 21:53 UTC, Aleksander Morgado
committed Details | Review

Description Aleksander Morgado 2012-11-15 10:42:51 UTC
Steps to reproduce:

* Start session
* Try to connect to a network which needs a password; e.g. a Wi-Fi network.
* gnome-shell pops up the dialog to ask for the secrets; that's ok.
* Now restart NetworkManager (e.g. sudo service NetworkManager restart or whatever applies in your distro).
* Try to connect to a network which needs a password; e.g. a Wi-Fi network.
* gnome-shell doesn't pop up the dialog to ask for the secrets; wrong.

This issue seems to be introduced by the following commit:
------------------------------------------------------------
2a800e4ce0912f098b4a469fc7a680ad094b3bfa
Author: Jasper St. Pierre <jstpierre@mecheye.net>
Date:   Sun Sep 2 22:23:50 2012 -0300

    Rearchitect the Shell to have a components system
------------------------------------------------------------

One of the changes done in the commit is moving from:
  this._native = new Shell.NetworkAgent({
     auto_register: true,
     identifier: 'org.gnome.Shell.NetworkAgent' });

To:
  this._native = new Shell.NetworkAgent({
     auto_register: false,
     identifier: 'org.gnome.Shell.NetworkAgent' });

Some other changes were added in the commit; like new enable() and disable() methods in the NetworkAgent object, likely to register() and unregister() the network agent, but I didn't find any place where these were being executed.


If you relaunch NetworkManager with --log-level=DEBUG, you'll actually see that if using a gnome-shell snapshot before that commit we get the agent registered:
[nm-agent-manager.c:297] impl_agent_manager_register(): (:1.253/org.gnome.Shell.NetworkAgent/1000) requesting permissions
[nm-agent-manager.c:227] agent_register_permissions_done(): (:1.253/org.gnome.Shell.NetworkAgent/1000) agent registered

But no such log will be given if using gnome-shell git master or just git at commit 2a800e4ce0912f098b4a469fc7a680ad094b3bfa.

If you completely restart gnome-shell, though, it will register the agent correctly. Just on NM restart it won't re-register it, which it should.
Comment 1 Aleksander Morgado 2012-11-15 11:10:56 UTC
BTW; I'm not suggesting a patch changing "auto_register: false" to "auto_register: true" because that's probably not the proper fix.

Just understood now that the NetworkAgent is now a 'component', which is enabled or disabled (registered or unregistered from NM) based on the session mode, so it probably is not the case that it should always be re-registered. But, when thee component is supposed to be enabled according to the session mode, and the NetworkManager dbus name owner changes, the NetworkAgent really needs to re-register.
Comment 2 Aleksander Morgado 2012-11-15 21:53:46 UTC
Created attachment 229101 [details] [review]
Patch for the issue.

The attached patch seems to fix the issue for me.
Comment 3 drago01 2012-11-19 18:50:11 UTC
Review of attachment 229101 [details] [review]:

Makes sense.
Comment 4 Aleksander Morgado 2012-11-20 13:03:11 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.