mapbox / mapbox/mapbox-navigation-android

MapboxNavigation doesn't fetch a new route for offRoute and new `RerouteController`

Open
#5,840 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Core jira-sync-complete
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

#### I issue: Incorrect reroute controller checks in `MapboxNavigation`
`fun setRerouteController` for `NavigationRerouteController` is not working correctly. It checks if **a new rerouteController** is fetching route, but must check legacy.
https://github.com/mapbox/mapbox-navigation-android/blob/09cd530425a2ec891e39f9d2fa0ff6a729cc1af9/libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt#L1131-L1139

there's working right
https://github.com/mapbox/mapbox-navigation-android/blob/09cd530425a2ec891e39f9d2fa0ff6a729cc1af9/libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt#L1116-L1124

#### II issue: If a current reroute controller is disabled for some time a new route might not be fetched at all
The only condition that is checked if the current `rerouteControler` is _fetching_ route, but actually if a`rerouteController` does not exist or it failed the SDK doesn't try to fetch a new route. Must be checked `offRoute` state as well

https://github.com/mapbox/mapbox-navigation-android/blob/09cd530425a2ec891e39f9d2fa0ff6a729cc1af9/libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt#L1120

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt at the referenced lines around 1116-1139. Compare the legacy and new RerouteController checks, then trace how offRoute state is handled when a controller is absent, disabled, or has failed; done means off-route navigation can fetch a new route in those cases and the controller checks target the correct instance.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.