We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using the directions API like so:
builder = (...) MapboxDirections client = builder.build(); client.enqueueCall(new Callback<DirectionsResponse>() { @Override public void onResponse(@NonNull Call<DirectionsResponse> call, @NonNull Response<DirectionsResponse> response) { (...) } @Override public void onFailure(@NonNull Call<DirectionsResponse> call, @NonNull Throwable throwable) { (...) } });
if no route can be found, then onResponse will be called twice.
onResponse
This is highly surprising/unexpected, and in our case, caused a crash.
This should be called only once.
It is called twice.
a return should be added right after this line: https://github.com/mapbox/mapbox-java/blob/master/services-directions/src/main/java/com/mapbox/api/directions/v5/MapboxDirections.java#L161
return
A call should be made that results in a NoRoute response (for instance, 2.308538,48.852698 to 120.960515,23.69781). See above.
NoRoute
In our case this produced a crash because we use an Rx SingleEmitter and onError must not be called twice.
SingleEmitter
onError
See "possible solution" above.
The text was updated successfully, but these errors were encountered:
Thanks for reporting, I suspect you're correct with the possible solution but will need to double check this and add a fix.
Sorry, something went wrong.
No branches or pull requests
When using the directions API like so:
if no route can be found, then
onResponse
will be called twice.This is highly surprising/unexpected, and in our case, caused a crash.
Expected Behavior
This should be called only once.
Current Behavior
It is called twice.
Possible Solution
a
return
should be added right after this line:https://github.com/mapbox/mapbox-java/blob/master/services-directions/src/main/java/com/mapbox/api/directions/v5/MapboxDirections.java#L161
Steps to Reproduce
A call should be made that results in a
NoRoute
response (for instance, 2.308538,48.852698 to 120.960515,23.69781).See above.
Context (Environment)
In our case this produced a crash because we use an Rx
SingleEmitter
andonError
must not be called twice.Detailed Description
See "possible solution" above.
Possible Implementation
See "possible solution" above.
The text was updated successfully, but these errors were encountered: