When I started GNOME Maps with MAPS_DEBUG=1 I noticed that we got a lot of notications about updated location: Gjs-Message: JS LOG: DEBUG: Updated location: Gjs-Message: JS LOG: DEBUG: Updated location: Gjs-Message: JS LOG: DEBUG: Updated location: Gjs-Message: JS LOG: DEBUG: Updated location: Gjs-Message: JS LOG: DEBUG: Updated location: Gjs-Message: JS LOG: DEBUG: Updated location: One every second, but the location did not seem to change. This seems like a bug.
Created attachment 119385 [details] [review] gclue-simple: Only notify on location change We only want to notify on the 'location' property if the location actually has changed. Otherwise the applications will perform their callback code to often.
I'm not sure why this is needed, especially on library level. If geoclue says that location has been updated, you need to point to the new location anyway, cause the previous location instance will not be kept around forever. I'm afraid you'd want to dig into service code to see why you are getting redundant location updates. If I were to guess, it's cause wifi networks around you are changing (signal strength etc) and somehow geoclue fails to filter the duplication location. http://cgit.freedesktop.org/geoclue/tree/src/gclue-locator.c#n78
(In reply to Zeeshan Ali from comment #2) > http://cgit.freedesktop.org/geoclue/tree/src/gclue-locator.c#n78 It seem to me that the second comparison here: if (geocode_location_get_distance_from (gloc, cur_gloc) * 1000 < geocode_location_get_accuracy (gloc) && geocode_location_get_accuracy (gloc) > geocode_location_get_accuracy (cur_gloc)) { should be old_accuracy >= new_accuracy otherwise we always update the location if the accuracy doesn't change (which is likely?)
(In reply to Rui Tiago Matos from comment #3) > (In reply to Zeeshan Ali from comment #2) > > http://cgit.freedesktop.org/geoclue/tree/src/gclue-locator.c#n78 > > It seem to me that the second comparison here: > > if (geocode_location_get_distance_from (gloc, cur_gloc) * 1000 < > geocode_location_get_accuracy (gloc) && > geocode_location_get_accuracy (gloc) > > geocode_location_get_accuracy (cur_gloc)) { > > should be old_accuracy >= new_accuracy otherwise we always update the > location if the accuracy doesn't change (which is likely?) I guess but note that the first part of condition means that we are talking of the case where the distance between new and last location is within the accuracy circle of the new location, which isn't very likely? This logic isn't checking if the location is the same and it doesn't intend to. The thing is that we want to give app location update each time a source reports an update. For some sources (e.g GPS), it makes sense to report location every second, since the timestamp of accurate locations can be important for apps. For others (e.g wifi), we need better methods of filtering location updates. Also note that there are two properties that control how often app wants the location update: https://www.freedesktop.org/software/geoclue/docs/gdbus-org.freedesktop.GeoClue2.Client.html#gdbus-property-org-freedesktop-GeoClue2-Client.DistanceThreshold https://www.freedesktop.org/software/geoclue/docs/gdbus-org.freedesktop.GeoClue2.Client.html#gdbus-property-org-freedesktop-GeoClue2-Client.TimeThreshold
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/geoclue/geoclue/issues/66.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.