mapbox / mapbox/mapbox-navigation-android
MapboxNavigation doesn't fetch a new route for offRoute and new `RerouteController`
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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