mapbox / mapbox/mapbox-java

RetryAndFollowUpInterceptor - java.io.IOException: Canceled

Đang mở
#1,566 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Java
Star
438
Fork
117
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với buildDirectionsApiClient và callback enqueueCall được nêu trong báo cáo, sau đó lần theo cách Mapbox Directions SDK sử dụng Retrofit và OkHttp liên quan đến việc hủy. Tái hiện trường hợp IOException: Canceled xảy ra không liên tục và xác định xem lệnh gọi có bị hủy bởi vòng đời của client hay bởi các yêu cầu đồng thời hay không. Công việc được xem là hoàn tất khi nguyên nhân hủy đã được xác định và được ghi lại bằng một trường hợp có thể tái hiện hoặc một lỗi SDK đã được xác nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, java
Lĩnh vực
api, mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.