Rerouting discards original route selection in favor of alternative route #3927
Labels
bug
Something isn’t working
Core
Work related to core navigation and integrations.
topic: directions
#3907 implemented a feature that detects new alternative routes on the fly during the trip. Unfortunately, when ReroutingController detects a deviation onto an alternative route, RouteController switches to it automatically. This is essentially a regression of #818 #1211: the user’s original route selection is discarded in favor of the router’s opinion of the most optimal route.
If the user intentionally chose long route B over long route A but unintentionally starts to travel along route A close to the beginning, where the deviation is insignificant, then RouteController automatically switches to route A, disregarding the user’s original selection of route B for the remainder of the trip, until the user realizes the problem and hopefully returns to route B on their own, without the assistance of the navigation SDK.
Before switching to the alternative route, RouteController consults client code via the
Router.router(_:shouldRerouteFrom:)
method. Most applications do not expect to implement this delegate method, which was originally intended for overriding the default rerouting behavior in a bring-your-own-route use case. As a fallback, RouteController consults theDefaultBehavior.shouldRerouteFromLocation
constant (true
), which was intended for actual reroutes onto unrelated routes, not alternative routes.mapbox-navigation-ios/Sources/MapboxCoreNavigation/RouteController.swift
Line 860 in aa0023f
The navigation SDK doesn’t necessarily know why the user chose route B over route A in the first place. For that matter, the application probably doesn’t know either. Maybe it was because of tolls or construction or stop-and-go traffic, or maybe they simply prefer the scenery along one road over that of another. But in principle, as long as we offer the user that choice initially, we should not disregard it so casually. Allowing the user to affirmatively switch to a new route would eliminate this ambiguity. We should consider disabling this behavior by default until #3598 is implemented. #3598 should be a lot more feasible now that #3907 has landed and #3850 is underway.
/ref mapbox/mapbox-navigation-android#3333
/cc @mapbox/navigation-ios @LukasPaczos @kmadsen @lawsonkight
The text was updated successfully, but these errors were encountered: