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

high accuracy mode shouldn't turn on while inside zone #4997

Open
yshui opened this issue Jan 20, 2025 · 11 comments
Open

high accuracy mode shouldn't turn on while inside zone #4997

yshui opened this issue Jan 20, 2025 · 11 comments
Labels
bug Something isn't working location-tracking question Further information is requested

Comments

@yshui
Copy link

yshui commented Jan 20, 2025

Steps to reproduce

  1. enable background location
  2. enable high accuracy when entering zone
  3. set high accuracy mode trigger range for zone to something > 0 (say, 300m)
  4. enter selected zone

Expected behavior

When I am far away from the selected zone, high accuracy should be off. When I get within 300m of the zone, high accuracy should turn on. After I have entered the zone, it should turn off.

Actual behavior

High accuracy stayed on after I have entered. Sometimes, it even turns itself on when I am inside the zone.

@yshui yshui added the enhancement New feature or request label Jan 20, 2025
@jpelgrom
Copy link
Member

jpelgrom commented Jan 20, 2025

Your expected behavior is correct (see example), so this is most likely bug.

In Settings > Companion app > Troubleshooting > Location history, you can check all received locations by the app - look for events saying geofence enter/exit, as that is used to toggle the mode on and off. Maybe some expected events are missing.

If there are no obvious issues there, could you reproduce the issue and provide the app logs, and more details about the device? You'll want to redact the coordinates in the logs. Then we can maybe find out what the issue is.

@jpelgrom jpelgrom added bug Something isn't working location-tracking question Further information is requested and removed enhancement New feature or request labels Jan 20, 2025
@yshui
Copy link
Author

yshui commented Jan 20, 2025

I saw a "zone entered" event in the log when i should already be in the zone, it's marked with a "very old location". don't know what that means

@jpelgrom
Copy link
Member

That means that when the app received the zone event, the location attached to it was >5 min old. The fact that it happened while you were already in the zone shouldn't be a major issue, geofences are expected to have up to a few minutes delay and the location attached to it isn't used for high accuracy mode. Make sure the app is allowed to run in the background/battery usage is unrestricted to reduce those delays as much as possible.

Any other zone events? With one there's not much to go on.

@yshui
Copy link
Author

yshui commented Jan 21, 2025

geofences are expected to have up to a few minutes delay

I wasn't being clear enough. There was already a previous zone enter event for that zone. About a couple of hours later, without me going anywhere, there was another zone enter for the same zone, with "very old location". I think high accuracy mode was enabled around that time too (not 100% sure).

@yshui
Copy link
Author

yshui commented Jan 22, 2025

also, is there a way to export the location history? because high accuracy was enabled for hours (hence the bug report), it was sending location every 5 seconds. so there are a huge number of events I have to scroll through every time.

edit: oops, too late. the events are already gone :/

@jpelgrom
Copy link
Member

There is no way to export the location history list.

Double checked the code for receiving a zone again but I don't see how that would cause your issue.

Unfortunately there isn't really any useful information yet. It would be best if you could open the app, reproduce the issue (you can turn the screen off), and when done get the debug logs from Settings > Companion app > Troubleshooting > Show and share logs. This will be very long but should include precise details for why the app is enabling/disabling high accuracy mode.

@yshui
Copy link
Author

yshui commented Jan 24, 2025

the logs don't go far back enough. i noticed that high accuracy mode turned on in the background and open the app. the logs only started after i opened the app and nothing before that was there. is there another way or do i need to keep the app open at all times?

@yshui
Copy link
Author

yshui commented Jan 24, 2025

also i hit this again and that "Zone entered (very old location)" event correlate exactly with when the high accuracy mode was enabled.

again the same thing, "zone entered" first, then about 2 hours later, "zone entered (very old location)" and high accuracy turned on at the same time.

@yshui
Copy link
Author

yshui commented Jan 24, 2025

does this hypothesis make sense:

  1. me enter zone, phone sends zone entered, and thinks i am in the zone.
  2. because of, e.g. gps inaccuracies, my coordinates go out of the zone, phone thinks i am out of the zone, turns on high accuracy, but skips sending zone exit because location is old.
  3. my coordinates return to the zone, but because of the skipped zone enter event, phone thinks the zone didn't change and doesn't turn off high accuracy mode.

@dshokouhi
Copy link
Member

again the same thing, "zone entered" first, then about 2 hours later, "zone entered (very old location)" and high accuracy turned on at the same time.

can you check the locations of several reports in the history both before and after that very old event? do they all look correct or do you see any of them jumping around unexpectedly?

@yshui
Copy link
Author

yshui commented Jan 24, 2025

i can see the skipped very old event has gpsAccuracy=100 so it's not accurate.

i can probably hack around this with a notification command...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working location-tracking question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants