-
Notifications
You must be signed in to change notification settings - Fork 319
Fix Navigator.reset regression #2905
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
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would this change any behavior? MapboxNativeNavigatorImpl is still an object?
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the fix?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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