-
Notifications
You must be signed in to change notification settings - Fork 320
Fix Events distanceTraveled not being accumulated
#5191
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
Conversation
cc8214b to
78adb88
Compare
78adb88 to
a2df739
Compare
|
Capturing from @Pavel-4
This is ready for review 🚀 |
LukasPaczos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a couple of nits to address separately if we can.
| assertTrue(events[1] is NavigationDepartEvent) | ||
| assertTrue(events[2] is NavigationRerouteEvent) | ||
| assertTrue(events[3] is NavigationRerouteEvent) | ||
| assertEquals(30, (events[3] as NavigationRerouteEvent).distanceCompleted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| assertEquals(30, (events[3] as NavigationRerouteEvent).distanceCompleted) | |
| assertEquals(ROUTE_PROGRESS_DISTANCE_TRAVELED * 2, (events[3] as NavigationRerouteEvent).distanceCompleted) |
| val dynamicValues = sessionMetadata?.dynamicValues | ||
| val currentDistanceTraveled = dynamicValues?.currentDistanceTraveled ?: 0 | ||
| val accumulatedDistanceTraveled = dynamicValues?.accumulatedDistanceTraveled ?: 0 | ||
| val distanceCompleted = currentDistanceTraveled + accumulatedDistanceTraveled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated in multiple places, maybe worth an extension?
| updateRoute(anotherRoute, RoutesExtra.ROUTES_UPDATE_REASON_REROUTE) | ||
| locationsCollector.flushBuffers() | ||
| every { routeProgress.currentState } returns OFF_ROUTE | ||
| updateRouteProgress(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| updateRouteProgress(1) | |
| updateRouteProgress(count = 1) |
a2df739 to
2ec578e
Compare
Description
distanceTravelednot being accumulatedRegression from #3540 https://github.com/mapbox/mapbox-navigation-android/pull/3540/files#diff-c5b716f21ea8e298bbe4b1f715880f4d4e8f1a8d4d42fbeb1008f286f0587c55L632-L634
Opening this as a
Draftto get initial feedback while doing further testing downstream.cc @baddleydone @truburt @Pavel-4 @bamx23