mapbox/mapbox-navigation-android

instructionIndex is null message

wirthandras opened this issue · 2 comments

Hello!

We got message sometimes from navigation lib like this "instructionIndex is null"

Our business code is request a new route on custom events during navigation (not just once).
And the requested new route has shared waypoints with the previous one.
And We are using silent waypoints except first and last waypoints.

mapboxNavigation.requestRoutes(
            RouteOptions.builder()
                .applyDefaultNavigationOptions()
                .applyLanguageAndVoiceUnitOptions(this)
                .coordinatesList(coordinates)
                .waypointIndicesList(
                    listOf(0, lastIndex)
                )
                .build(),
            object : NavigationRouterCallback {
                override fun onCanceled(routeOptions: RouteOptions, routerOrigin: RouterOrigin) {
                    // no impl
                }

                override fun onFailure(reasons: List<RouterFailure>, routeOptions: RouteOptions) {
                    // no impl
                }

                override fun onRoutesReady(
                    routes: List<NavigationRoute>,
                    routerOrigin: RouterOrigin
                ) {
                  mapboxNavigation.setNavigationRoutes(routes)
                }
            }
        )

implemetation based of this example

Android API: 28
Mapbox Navigation SDK version: 2.19.0

Steps to trigger behavior

  1. Request a route start navigation
  2. Little delay or travel to half of the path
  3. Request a new route and set it again.. and again until custom end.

Expected behavior

no instructionIndex is null message and no weird navigation

Actual behavior

instructionIndex is null message occured some times, and the navigation became weird, (weird == navigation seems lost, the progress observer produce false data related to remaining waypoint count)
Our experience say mostly happen in intersections, but not at all