Skip to content

Conversation

@Guardiola31337
Copy link
Contributor

Description

Resets Navigator when in on TripSession#stop and renames DirectionsSession shutdown API

Fixes #2769

  • I have added any issue links
  • I have added all related labels (bug, feature, new API(s), SEMVER, etc.)
  • I have added the appropriate milestone and project boards

Goal

As MapboxNativeNavigatorImpl is a singleton (object) Navigator is retained between sessions causing unexpected behaviors as the internal cache is not reset

Implementation

  • Add reset API to MapboxNativeNavigator and recreate Navigator when MapboxNativeNavigatorImpl#reset
  • Rename MapboxDirectionsSession shutdown API from shutdownSession to shutdown

Testing

  • I have tested locally (including SNAPSHOT upstream dependencies if needed) through testapp/demo app and run all activities to avoid regressions
  • I have tested via a test drive, or a simulation/mock location app
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have updated the CHANGELOG including this PR

cc @kmadsen @cafesilencio @SiarheiFedartsou

@Guardiola31337 Guardiola31337 added bug Defect to be fixed. ✓ ready for review Core Work related to core navigation and integrations. labels Apr 29, 2020
@Guardiola31337 Guardiola31337 added this to the v1.0.0 milestone Apr 29, 2020
@Guardiola31337 Guardiola31337 requested review from a team, cafesilencio and kmadsen April 29, 2020 00:24
@Guardiola31337 Guardiola31337 self-assigned this Apr 29, 2020
@codecov-io
Copy link

Codecov Report

Merging #2850 into master will decrease coverage by 0.00%.
The diff coverage is 40.00%.

@@             Coverage Diff              @@
##             master    #2850      +/-   ##
============================================
- Coverage     35.43%   35.43%   -0.01%     
  Complexity     2101     2101              
============================================
  Files           544      544              
  Lines         19536    19539       +3     
  Branches       1841     1841              
============================================
+ Hits           6922     6923       +1     
- Misses        11788    11790       +2     
  Partials        826      826              

@Guardiola31337 Guardiola31337 merged commit cac6326 into master Apr 29, 2020
@Guardiola31337 Guardiola31337 deleted the pg-reset-nn branch April 29, 2020 01:02
* Reset resources.
*/
override fun reset() {
navigator = Navigator()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably want to reset the other things, like route

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

Labels

bug Defect to be fixed. Core Work related to core navigation and integrations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Camera / location off after running GuidanceViewActivity

4 participants