mapbox / mapbox/mapbox-navigation-android

Getting Error: Refused to schedule onboard router request as pending request with id 1 has already finished

Open
#7,871 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

Hi ,

I am creating an app where user can configure locations for routes and I use mapbox to draw optimized routes based on the user's selected locations.
So initially when the app launched, I have some dummy locations which I optimize for shorted route using MapboxOptimizationAPI. Then after I show that route on map.
This works fine. But I have strange problem. After initially route has been decided, if I want to add new location to existing route and then re-ask Mapbox to provide route in this case I am getting "Refused to schedule onboard router request as pending request with id 1 has already finished" error and always timeout.

However, if i do not initiate route request to mapbox initially(when app launched), and in this case if I add /update/delete locations and re-ask mapbox to provide me route then it works fine.
I am not sure what is happening as both request are just same only one extra location.

Initial Request: https://api.mapbox.com/directions/v5/mapbox/driving/72.5088127,23.0277154;72.528799,23.038374;72.563378,23.042054;72.56928,23.04024;72.571362,23.022505;72.601948,23.003785?access_token=****Ad_Q&geometries=polyline6&alternatives=true&overview=full&steps=true&layers=0%3B%3B%3B%3B%3B&continue_straight=true&annotations=congestion_numeric%2Cmaxspeed%2Cclosure%2Cspeed%2Cduration%2Cdistance&language=en&roundabout_exits=true&voice_instructions=true&banner_i...

After adding new location Request: https://api.mapbox.com/directions/v5/mapbox/driving/72.5088127,23.0277154;72.528799,23.038374;72.563378,23.042054;72.56928,23.04024;72.571362,23.022505;72.601948,23.003785;72.5590226,23.0762103?access_token=****Ad_Q&geometries=polyline6&alternatives=true&overview=full&steps=true&layers=%3B%3B%3B%3B%3B%3B&continue_straight=true&annotations=congestion_numeric%2Cmaxspeed%2Cclosure%2Cspeed%2Cduration%2Cdistance&language=en&roundabout_exits=true&voice_instru...

I have attached my Activity file for your reference.

Please suggest me what I am doing wrong.

I have already opened ticket on Mapbox Support Center(https://support.mapbox.com/hc/en-us/requests/160654), but i haven't received any response on it.
I have a subscription plan purchased and still not received any response since last 13 days so i am creating an issue on Github.

**Android API:**
**Mapbox Navigation SDK version:** : 3.2.0-rc.1

### Steps to trigger behavior
Description has all details for triggering
1. Request route multiple times

[RoutePreviewActivity.txt](https://github.com/user-attachments/files/17109657/RoutePreviewActivity.txt)

### Expected behavior
1. It should provide route information on Turn by Turn Navigation.

### Actual behavior
Getting Error: Refused to schedule onboard router request as pending request with id 1 has already finished

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.

Research direction

Start with the attached RoutePreviewActivity.txt and reproduce the initial route request followed by a request after adding a location using Mapbox Navigation SDK 3.2.0-rc.1. Compare the request lifecycle and logs for the two cases; done means the repeated request no longer times out and returns route information.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.