Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerouting discards original route selection in favor of alternative route #3927

Closed
1ec5 opened this issue May 31, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn’t working Core Work related to core navigation and integrations. topic: directions

Comments

@1ec5
Copy link
Contributor

1ec5 commented May 31, 2022

#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 the DefaultBehavior.shouldRerouteFromLocation constant (true), which was intended for actual reroutes onto unrelated routes, not alternative routes.

if delegate?.router(self, shouldRerouteFrom: location) ?? DefaultBehavior.shouldRerouteFromLocation {

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

@1ec5 1ec5 added bug Something isn’t working topic: directions Core Work related to core navigation and integrations. labels May 31, 2022
@MaximAlien
Copy link
Contributor

@Udumft, as per grooming session assigning this one to you.

@Udumft
Copy link
Contributor

Udumft commented Jun 17, 2022

Since #3907 and #3850 are landed, I assume #3598 should be resolved by #3956, which will close the topic of alternative routes selection and displaying, thus also resolving current ticket.

@Udumft
Copy link
Contributor

Udumft commented Jun 29, 2022

#3956 is landed, so that should wrap the feature.

@Udumft Udumft closed this as completed Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working Core Work related to core navigation and integrations. topic: directions
Projects
None yet
Development

No branches or pull requests

3 participants