Fix Navigator.reset regression#2905
Conversation
…n on destroy only
fe2198b to
d48bb7e
Compare
Codecov Report
@@ Coverage Diff @@
## master #2905 +/- ##
=========================================
Coverage 35.46% 35.46%
Complexity 2110 2110
=========================================
Files 545 545
Lines 19571 19575 +4
Branches 1846 1846
=========================================
+ Hits 6940 6942 +2
- Misses 11804 11806 +2
Partials 827 827 |
| ): DirectionsSession = | ||
| MapboxDirectionsSession(router) | ||
|
|
||
| fun createNativeNavigator(): MapboxNativeNavigator = MapboxNativeNavigatorImpl |
There was a problem hiding this comment.
why would this change any behavior? MapboxNativeNavigatorImpl is still an object?
There was a problem hiding this comment.
This is for mocking MapboxNativeNavigator in tests, native code and JUnit don't get along 😬 Some time back I did this https://github.com/mapbox/mapbox-gl-native/pull/8261/files#diff-20a30dbc2607de725d1e4d09e2bd1403 to workaround the issue. Maybe we can bring it to the Navigation SDK
| enhancedLocation = null | ||
| routeProgress = null | ||
| isOffRoute = false | ||
| navigator.reset() |
There was a problem hiding this comment.
Correct so we only reset the Navigator when in onDestroy
| tripSession.unregisterAllBannerInstructionsObservers() | ||
| tripSession.unregisterAllVoiceInstructionsObservers() | ||
| tripSession.route = null | ||
| navigator.reset() |
There was a problem hiding this comment.
can we make this fix be, only moving the navigator.reset()?
The NavigationComponentProvider looks like a change that doesn't do anything, right?
There was a problem hiding this comment.
The
NavigationComponentProviderlooks like a change that doesn't do anything, right?
See comment above. It's needed to mock MapboxNativeNavigator in order to keep onDestroyCallsNativeNavigatorReset test.
Description
Fix
Navigator#resetregression from #2850bug,feature,new API(s),SEMVER, etc.)Goal
The
Navigatorwas reset when stopping a trip session (e.g. stopping from theMapboxTripNotification) removingMapboxTripSession.routeNavigators stateImplementation
navigator.resetout fromMapboxTripSessiontoMapboxNavigation#onDestroyonlyTesting
SNAPSHOTupstream dependencies if needed) through testapp/demo app and run all activities to avoid regressionsChecklist
CHANGELOGincluding this PRcc @Lebedinsky