-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Shows "Location not available" despite GPS being on in Nearby tab #3924
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
Comments
I noticed that too. It happens only the first time you open Nearby, right? |
Actually yes, this happens when the last known location is null. Enabling location does not always mean that we have the location. So in that case, when we do receive the location, which happens almost instantly if the permission is enabled, we use the location to show nearby pins. |
No, this happens every time. This is not a new phenomenon, it also happened when I tried using the app 1-2 years ago.
In my test, another app (osmand) was constantly showing the correct location. |
Hey @heinrich5991 , so even after allowing location permission, nearby does not work for you? |
Yes, this is correct. |
@nicolas-raoul Do you face the same issue?. |
Had to figure out how to filter it to just that app. From the point when I click on "Nearby" (I do it twice in the log). Looks interesting, an exception is thrown.
|
Oh, might also be interesting (don't know if this makes a WONTFIX): The device doesn't have Play Services or MicroG installed. |
Exception seems to be expected by the code apps-android-commons/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java Lines 61 to 75 in 3f23ea0
called at apps-android-commons/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java Lines 48 to 53 in 3f23ea0
|
But it seems that the GPS provider isn't called when the network provider fails due to the short-circuiting of &&. Is that the bug? |
@ashishkumar468 not same as it only happens the first time for me, sorry for the noise! 😅 |
apps-android-commons/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java Lines 48 to 53 in ffdfb05
I think the fix might be as simple as changing this |
Can I work on this one ? The mentioned issue happens for the first time you login. As written in the steps to reproduce this bug @heinrich5991
This clears all the data from the app also the last location from the app, so when you login again the app tries to fetch the last location which is not available . Thus the call to last location of the app returns null causing the app to show the message. According to me, Correct me if I missed something. @ashishkumar0207 @nicolas-raoul |
The problem is not that the error message is shown. The problem is that the location is never determined. Removing the error message would not fix my issue. |
I totally agree with it, but the problem is that it can't be determined either, as this is the first time the fragment is being loaded. Refining the test conditions would be my shot on it. Really want to fix this, would be really nice if I get some input on other possible ways to handle this situation. @ashishkumar468 @nicolas-raoul Thx. |
apps-android-commons/app/src/main/java/fr/free/nrw/commons/location/LocationServiceManager.java Lines 48 to 53 in ffdfb05
Fixing this is really worth trying, the '&&' should be replaced by '||' IMO |
Hi @4D17Y4 , please see Ashish's comment. :) Feel free to submit a PR for this and we will review. |
I'm on it @misaochan, |
I am not sure about the other issue, or if this would solve the issue for this , but
I am not sure about the other issue, or if this would solve the issue completely(since the device does not have play-services), but the short-circuiting is clearly a bug, I will be raising a PR for that, soon, once that goes to beta (and if we are not able to solve this by then), rolling this out will help for sure and we would at least know that if the network provider does not work in @heinrich5991 ' s device, are the GPS providers working as expected |
I've tried replacing I do agree with the issue that GPS one won't be called if the Network turns out to be false. For that, I can change Thanks. |
Thanks @4D17Y4 , have you been able to reproduce this issue in your device, if yes will it be possible to share the steps to reproduce this? |
Sure @ashishkumar0207,
|
@4D17Y4 Thanks for sharing the steps, although this issue seems different, @heinrich5991 's issue is that Nearby never updates the location in his device. |
Apparently, I overlooked the discussion that followed the issue. |
Should I open a new issue for fixing the mentioned bug, as I have the PR ready and linked here? and I think the issue would be quite similar to this one. |
@misaochan @4D17Y4 @ashishkumar468 Is this issue still there in the latest master. I can't reproduce it by the above-mentioned steps. |
I also haven't seen this in a while. |
Summary:
The app shows "Location not available" in the Nearby tab, even though location is enabled for the app and the precise location is also available (another app can display the exact position).
Steps to reproduce:
Device and Android version:
Nexus 5X, Android 8.1.0, LineageOS 15.1, without Google Play Services and MicroG.
Commons app version:
2.13.1~917a94472 via F-Droid.
Would you like to work on the issue?
No.
The text was updated successfully, but these errors were encountered: