mapbox / mapbox/mapbox-navigation-ios

[Bug]: Navigation spams route alternatives each second

Open
#4,566 3 comments 0 reactions 1 assignee View on GitHub

@kried is already working on this.

Since Oct 30, 2023.

bug
Dominant language
Swift
Stars
918
Forks
326
Avg merge
1h 16m
Merged PRs (30d)
3

Description

### Mapbox Navigation SDK version

2.17.0

### Steps to reproduce

Start a step by step navigation which has alternative routes displayed on the mapview. The navigation will startstuttering / flashing the route. Checking the logs will show you that the reroutes get spammed each second.

### Expected behavior

The Navigation Controller should do nothing when the user is not moving. No alternatives should be selected or removed.

### Actual behavior

The Console spams this:

`[Info, nav-native]: RouteAlternativesControllerImpl::onStatus alternatives=[ ], removed=[ altId=309(routeId=HhZKQhlziKK239kZfzHh9azxoYxAL7zU5UZDwew0jV5awfLuAlvlEQ==_eu-west-1#1) ]

[Info, nav-native]: Requesting online route id 151: https://api.mapbox.com/directions/v5/mapbox/driving-traffic/LINK-REMOVED-FOR-SAFETY
[Info, nav-native]: ParallelHybridRouter::getRoute: Timeout for task with id 141 triggered but request not found
[Info, nav-native]: ParallelHybridRouter::getRoute: Refused to schedule onboard router request as pending request with id 149 has already finished
[Info, nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ ], removed=[ ]
[Info, navigation-ios/navigation]: Navigator alternative routes has been updated (0 alternatives set).
[Info, nav-native]: OnlineRouter::getRoute req id 151 successfully returns
[Info, nav-native]: Online response id 151 returned 146769 bytes
[Info, nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ altId=311(routeId=HhZKQhlziKK239kZfzHh9azxoYxAL7zU5UZDwew0jV5awfLuAlvlEQ==_eu-west-1#1) ], removed=[ ]
[Info, navigation-ios/navigation]: Navigator alternative routes has been updated (1 alternatives set).
[Info, navigation-ios/navigation]: Navigator alternative routes has been updated (1 alternatives set).
[Info, nav-native]: RouteAlternativesControllerImpl::onStatus alternatives=[ ], removed=[ altId=311(routeId=HhZKQhlziKK239kZfzHh9azxoYxAL7zU5UZDwew0jV5awfLuAlvlEQ==_eu-west-1#1) ]
[Info, nav-native]: Requesting online route id 152: https://api.mapbox.com/directions/v5/mapbox/driving-traffic/LINK-REMOVED-FOR-SAFETY
[Info, nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ ], removed=[ ]
[Info, navigation-ios/navigation]: Navigator alternative routes has been updated (0 alternatives set).
[Info, nav-native]: ParallelHybridRouter::getRoute: Timeout for task with id 142 triggered but request not found
[Info, nav-native]: ParallelHybridRouter::getRoute: Refused to schedule onboard router request as pending request with id 150 has already finished
[Info, nav-native]: OnlineRouter::getRoute req id 152 successfully returns
[Info, nav-native]: Online response id 152 returned 146769 bytes
[Info, nav-native]: RouteAlternativesControllerImpl::setRoutes isAlternativesChanged. alternatives=[ altId=313(routeId=HhZKQhlziKK239kZfzHh9azxoYxAL7zU5UZDwew0jV5awfLuAlvlEQ==_eu-west-1#1) ], removed=[ ]`

This just keeps going about once each second, even if the user does nothing, does not touch the screen or move in any way. The Route Layer begins flashing and the map stutters on each reload. I have noticed that it stops once the user manually selects one of the route alternatives. The navigation controller then stops automatically switching alternative.

### Is this a one-time issue or a repeatable issue?

repeatable

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.