mapbox / mapbox/mapbox-navigation-ios
Parallel copies of route in Router can get out of sync
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
Router implementations store both an IndexedRouteResponse (that is, a RouteResponse plus a route index) and a RouteProgress (that is, a Route plus a leg index etc.) side by side. As a result, they effectively hold two parallel copies of the current Route that can get out of sync. For example, after a reroute, RouteController sets the routeProgress property but neglects to update the indexedRouteResponse property:
This contrasts to LegacyRouteController, which does happen to set both properties:
In both RouteController and LegacyRouteController, routeProgress is publicly settable but indexedRouteResponse is not. This makes it entirely possible for client code to have inconsistent behavior depending on how it gets the route from the Router.
/cc @mapbox/navigation-ios
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.
Assessment
This issue has not been assessed yet.