Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

RetryAndFollowUpInterceptor - java.io.IOException: Canceled

Abierto
#1,566 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
android, java
Área
api, mobile-dev

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.

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<DirectionsResponse> {
            override fun onResponse(
                call: Call<DirectionsResponse>,
                response: Response<DirectionsResponse>
            ) {
                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<DirectionsResponse>, 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

Lenguaje dominante
Java
Estrellas
438
Forks
117
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mapbox/mapbox-java

Todos los issues de mapbox/mapbox-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.