[Bug] : Fix isMinimumTimeBeforeRecalcExceeded#755
Merged
Conversation
Contributor
|
For future PRs, note that we use |
Contributor
|
Wow, good catch! I've done a clean-up pass and think this is good to merge + release after CI checks pass. The original PR actually introduced a subtle bug that didn't preserve the original behavior in case there was no prior recalculation. This wasn't picked up in the new unit tests but was luckily caught an unrelated integration test failure designed to exercise that part of the code 😅 I've fixed the issue and made a few other tweaks:
|
Contributor
Author
|
Thank you ian! |
radityagumay
commented
Dec 21, 2025
| return _lastRecalculationLocation?.let { | ||
| it.toAndroidLocation().distanceTo(location.toAndroidLocation()) > | ||
| minimumMovementBeforeRecalculation | ||
| } ?: true // Default to true if no prior automatic recalculation |
Contributor
Author
There was a problem hiding this comment.
this is make sense, i am about to make a changes of this. thank you @ianthetechie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Earlier the time comparison is using nanoseconds instead of seconds, the PR essentially to use TimeUnit.SECONDS to fix aggressive nano time usage.
In this PR i also extract the functionality into a function so that i can add a unit test to verify the logic.
Safety net
Providing unit tests to validate the logic < and > of 5 seconds