Skip to content

status/location: Handle geoclue not being activatable

Will Thompson requested to merge wip/wjt/handle-geoclue-not-being-activatable into main

In GNOME OS, due to a misconfiguration, geoclue was configured without systemd support. In that configuration, geoclue does not install its systemd .service file (geoclue.service) but it (incorrectly) includes the following line in its D-Bus service file anyway:

SystemdService=geoclue.service

As a result, when dbus-daemon tried to activate it at gnome-shell's request, it would fail with:

Unit geoclue.service not found

Then, GeoclueAgent._onGeoclueVanished() would be called, as the name_vanished_handler passed to Gio.bus_watch_name(). This is consistent with Gio.bus_watch_name()'s documentation:

You are guaranteed that one of the handlers will be invoked after calling this function.

But that function assumed that this._managerProxy is defined, leading to:

JS ERROR: TypeError: this._managerProxy is undefined
_onGeoclueVanished@resource:///org/gnome/shell/ui/status/location.js:163:9

Fix this by checking for nullishness of this._managerProxy. (Strictly speaking, it's undefined rather than being null, but other code in this file already uses the vaguer != null test, which considers undefined to be null.)

Edited by Will Thompson

Merge request reports