Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocationUpdated could never be called leading to GClueSimple API hang forever #1615

Open
ilya-fedin opened this issue Feb 1, 2025 · 4 comments
Labels

Comments

@ilya-fedin
Copy link
Contributor

Operating System

NixOS

XDG Desktop Portal version

1.18

XDG Desktop Portal version (Other)

No response

Desktop Environment

Plasma

Desktop Environment (Other)

No response

Expected Behavior

g_clue_simple_new_sync returns

Current Behavior

gclue_simple_new_sync hangs forever

Steps to Reproduce

#include <geoclue.h>

int main(int argc, char *argv[]) {
        g_autoptr(GClueSimple) simple = gclue_simple_new_sync("geoclue-where-am-i", GCLUE_ACCURACY_LEVEL_EXACT, NULL, NULL);
        GClueLocation *location = gclue_simple_get_location(simple);
        g_warning("Latitude: %f, Longitude: %f", gclue_location_get_latitude(location), gclue_location_get_longitude(location));
        return 0;
}

Anything else we should know?

The cause seem to be early returns in

location_updated (GeoclueClient *client,

If the location is unknown, the signal is never emitted and GClueSimple hangs forever. I believe portal should emit the singal at least once.

@ilya-fedin ilya-fedin added the bug label Feb 1, 2025
@swick
Copy link
Collaborator

swick commented Feb 4, 2025

So I guess GeoClue always emits this signal at least once? Technically I don't think we ever had that guarantee but I think it would make sense in location_session_start to block until we have the first location update and then raise an error to the client if the GeoClue call failed.

@ilya-fedin
Copy link
Contributor Author

No, it seem to be never emitted now that most systems have only MLS as location source and MLS doesn't work

@swick
Copy link
Collaborator

swick commented Feb 10, 2025

In that case I don't see why the behavior described in this issue is unexpected?

@ilya-fedin
Copy link
Contributor Author

I expect the API to return some error in case the location is unknown so that I can handle that, e.g. fallback to other source or present a error to the user, as well as destroy the related resources. Right now it just never returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants