Skip to content

Strengthen tracker's maximum distance safeguard by ensuring non-measurable distances are dismissed#7196

Merged
nirvn merged 1 commit into
masterfrom
tracker_max_distance_safeguard
Mar 28, 2026
Merged

Strengthen tracker's maximum distance safeguard by ensuring non-measurable distances are dismissed#7196
nirvn merged 1 commit into
masterfrom
tracker_max_distance_safeguard

Conversation

@nirvn
Copy link
Copy Markdown
Member

@nirvn nirvn commented Mar 25, 2026

Trying to debug this weird situation where tracks will have "spikes" even though the maximum distance safeguard is one. This is how it looks like:

image

I have no idea what these spikes are, but the only way I could hypothesize we'd end up there is if a/ the position vertex that creates the spike is somehow invalid, which would then b/ create an exception when calculating the distance. Under that scenario, we were setting the distance to 0.0 which defeated the max. distance safeguard.

The PR fixes that.

@qfield-fairy
Copy link
Copy Markdown
Collaborator

qfield-fairy commented Mar 25, 2026

🍎 MacOS DMG universal builds

Download a MacOS DMG universal build of this PR for testing.
(Built from commit 836638c)

📱 Android builds

Download an Android arm64 build of this PR for testing.
(Built from commit 836638c)

Other Android architectures

🪟 Windows builds

Download a Windows build of this PR for testing.
(Built from commit 836638c)

🐧 Linux AppImage builds

Download a Linux AppImage build of this PR for testing.
(Built from commit 836638c)

@Ipickedausername
Copy link
Copy Markdown

Can't wait to check that ! I used to delete these errors manually back in the office.

@nirvn
Copy link
Copy Markdown
Member Author

nirvn commented Mar 25, 2026

@Ipickedausername , interesting, are you suggesting that you were using a max. distance safeguard and yet would see these random spikes?

@nirvn
Copy link
Copy Markdown
Member Author

nirvn commented Mar 25, 2026

@Ipickedausername , I'm asking because I have not been able to replicate this misbehavior and I was wondering whether you had a clear understanding of the circumstances around this.

@Ipickedausername
Copy link
Copy Markdown

I tested on two phones :

  • Galaxy S9 > Every map was covered with these spikes.
  • Galaxy XCover 4 (or 5, not sure) > No problem.

I ended up thinking that my phone might not be working properly, or that the issue could be related to using the app in areas with poor network coverage.

Most of these “spikes” appeared when my phone screen was off while I was walking with the app open. Almost every time I unlocked my phone to check the map, the tracking session created a spike.

The spikes were not pointing in the same direction, although several of them were often going toward the same point. Radom point, but sometimes not that random (e. g. : the hotel I stayed the night, the place I parked my car).

@nirvn
Copy link
Copy Markdown
Member Author

nirvn commented Mar 25, 2026

@Ipickedausername , were you using the maximin distance safeguard to begin with?

@kochon
Copy link
Copy Markdown

kochon commented Mar 25, 2026

we are also affected by this issue. it seems to only happen on android.
image
i will install the android build on my employee's device and report back with more details

@Ipickedausername
Copy link
Copy Markdown

@Ipickedausername , were you using the maximin distance safeguard to begin with?

Hmm, I'm not sure now.
My last try was in June last year, will be back on it starting mid-April.

@nirvn nirvn merged commit 97b50ae into master Mar 28, 2026
28 checks passed
@nirvn nirvn deleted the tracker_max_distance_safeguard branch March 28, 2026 04:37
@kochon
Copy link
Copy Markdown

kochon commented Apr 7, 2026

Unfortunately the issue is still present on my employee's device. He mentioned to me that it seems to happen when either resuming tracking or when the screen is locked. We switched back to tracking on points layers for now.

@Ipickedausername
Copy link
Copy Markdown

Hi,
Same for me.
And the app stops working when I leave it in background, resulting in the loss of the tracks.

@nirvn
Copy link
Copy Markdown
Member Author

nirvn commented Apr 9, 2026

@Ipickedausername , @kochon , if you guys have a samsung phone, I've been told turning off Samsung's "precise positioning" helps greatly.

image

I only have the screenshot in French, desole ;)

@Ipickedausername
Copy link
Copy Markdown

Oh indeed !

Here is a comparison 1 hour with "precise positionning" on and 1 hour without.

Screenshot_20260423-125059 Screenshot_20260423-125105

Why is the max distance limitation not blocking this behavior ?

Thank you for the tip !

@nirvn
Copy link
Copy Markdown
Member Author

nirvn commented Apr 23, 2026

@Ipickedausername , I would sure love to know that. I'm investigating this further.

@Ipickedausername
Copy link
Copy Markdown

@Ipickedausername , I would sure love to know that. I'm investigating this further.

Maybe the max distance is calculated using the last calculated value, without considering if the last calculated one was valid or not. If 2 locations are detected 10km away from the user, but near each other, the first one, above n meters is canceled, but the second one, near the previously canceled one is consideres valid ?

Well, at least there is a way to avoir this issue on the user's end. Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants