mapbox-navigation-android icon indicating copy to clipboard operation
mapbox-navigation-android copied to clipboard

`startReplayTripSession` requires `stopTripSession`, or does it?

Open kmadsen opened this issue 2 years ago • 1 comments

Overview

Following up from an issue where we needed to add a debounce to handle rapid trip session state changes.

https://github.com/mapbox/mapbox-navigation-android/pull/6039/files#diff-9472754437da48cd5a28236f6b3804c5d3c0451d20b5d1735c9166360b68db75R22-R26

This ticket, is to explore if this is a necessary consequence or an issue that we can address.

Specifically, can we make it so the previous session does not need to be stopped? Is this stopTripSession required, if so why and how could we fix it inside startReplayTripSession?

        mapboxNavigation.stopTripSession() 
        mapboxNavigation.startReplayTripSession()

Considerations

  • startReplayTripSession is still experimental so we can make alterations if necessary.
  • Enable/disable simulated routes at runtime is mostly a developer productivity tool. But we do know of customers that have production experience that supports this.
  • mapboxNavigation.resetTripSession() is another required function in order make the navigator reset to a location

kmadsen avatar Jul 14 '22 16:07 kmadsen

Adding a note here as the debounce was removed. This issue still exists as an alternative solution is to "ignore trip session updates" while the trip session is being restarted https://github.com/mapbox/mapbox-navigation-android/pull/6140

I think we should make it so MapboxNavigation will figure this out so that these functions can be called in any order and the behavior will create the expected experience (without needing to call stopTripSession).

mapboxNavigation.startTripSession() 
mapboxNavigation.startReplayTripSession()

kmadsen avatar Aug 09 '22 22:08 kmadsen