RetryAndFollowUpInterceptor - java.io.IOException: Canceled
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 438
- Forks
- 117
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
## Issue
Multiple `RetryAndFollowUpInterceptor - java.io.IOException: Canceled`
## Description
We are getting randomly multiple `java.io.IOException: Canceled` when using the Mapbox Directions SDK. Code snippet is:
## SDK used
```
//Mapbox Directions API
implementation "com.mapbox.mapboxsdk:mapbox-sdk-services:6.13.0"
```
## Code Snippet
```
for origin = "Point{type=Point, bbox=null, coordinates=[-58.449951171875, -34.55467987060547]}"
for destination = Point{type=Point, bbox=null, coordinates=[-58.484619140625, -34.57625961303711]}
private fun buildDirectionsApiClient(origin: Point, destination: Point): MapboxDirections {
val routeOptions = RouteOptions.builder()
.geometries(DirectionsCriteria.GEOMETRY_POLYLINE6)
.overview(DirectionsCriteria.OVERVIEW_SIMPLIFIED)
.profile(DirectionsCriteria.PROFILE_DRIVING)
.coordinatesList(listOf(origin, destination))
.build()
return MapboxDirections.builder()
.accessToken(accessToken)
.routeOptions(routeOptions)
.build()
}
and the way we are executing the calls is:
client?.enqueueCall(object : Callback {
override fun onResponse(
call: Call,
response: Response
) {
response.body()?.routes()?.firstOrNull()?.let { route ->
mapbox.getStyle {
val source: GeoJsonSource? = it.getSourceAs(ROUTE_SOURCE_ID)
val lineString = LineString.fromPolyline(
route.geometry()!!,
Constants.PRECISION_6
)
// Set the map's camera position taking into account the route drawing
val coordinateList = lineString.coordinates()
animateMarker.setBoundary(coordinateList)
val camera = mapbox.cameraForCoordinates(coordinateList, getPadding())
mapbox.easeTo(camera, source, lineString)
}
}
}
override fun onFailure(call: Call, t: Throwable) {
DevMetrics.monitor(errorParams("Mapbox cannot draw route points reason is ${t.cause} - ${t.message}"))
onError()
}
})
```
Not sure if we are doing something wrong because it mostly works and draw the route but randomly it shows us this exception coming from `Retrofit and OkHttp`
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con buildDirectionsApiClient y el callback enqueueCall mostrado en el informe; después, sigue cómo el Mapbox Directions SDK utiliza Retrofit y OkHttp en relación con la cancelación. Reproduce el caso intermitente IOException: Canceled y determina si la llamada está siendo cancelada por el ciclo de vida del cliente o por solicitudes concurrentes. La tarea estará terminada cuando se haya identificado la causa de la cancelación y se haya documentado con un caso reproducible o con un defecto confirmado del SDK.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, java
- Área
- api, mobile-dev
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100