File tree Expand file tree Collapse file tree 5 files changed +35
-3
lines changed
base/src/main/java/com/mapbox/navigation/base/route
changelog/unreleased/features
main/java/com/mapbox/navigation/core/internal/router
test/java/com/mapbox/navigation/core/internal/router Expand file tree Collapse file tree 5 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import androidx.annotation.StringDef
1313 RouterFailureType .AUTHENTICATION_ERROR ,
1414 RouterFailureType .ROUTE_CREATION_ERROR ,
1515 RouterFailureType .RESPONSE_PARSING_ERROR ,
16+ RouterFailureType .ROUTER_RECREATION_ERROR ,
17+ RouterFailureType .MISSING_TILES_ERROR ,
1618 RouterFailureType .UNKNOWN_ERROR ,
1719)
1820annotation class RouterFailureType {
@@ -59,6 +61,11 @@ annotation class RouterFailureType {
5961 */
6062 const val ROUTER_RECREATION_ERROR = " ROUTER_RECREATION_ERROR"
6163
64+ /* *
65+ * Error caused by missing tiles required for route calculation
66+ */
67+ const val MISSING_TILES_ERROR = " MISSING_TILES_ERROR"
68+
6269 /* *
6370 * Error has an unknown type
6471 */
Original file line number Diff line number Diff line change 1+ - Introduce RouterFailureType::MISSING_TILES_ERROR to indicate inability to build a route due to missing routing tiles
Original file line number Diff line number Diff line change 1111 // mapboxSdkHdFullSparseCheckout in generate_api_docs_android.sh depends on mapboxSdkVersionSuffix
1212 // Release Train depends on these two lines below
1313 // https://github.com/mapbox/release-train/blob/bd530da200d62fb45166ef91d7d892d90a453fa6/backend/model/step/navcoreandroid/PrepareChangelogNavCore.py#L122-L124
14- def mapboxSdkVersionSuffix = ' 17.0-rc.3'
14+ def mapboxSdkVersionSuffix = ' 17.0-rc.3-SNAPSHOT-12-01--08-09.git-8ce4de4 '
1515 def mapboxNavigatorVersion = " 324.${ mapboxSdkVersionSuffix} "
1616
1717 def ndkVersionSuffix = " "
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ internal fun RouterErrorType.mapToSdkRouterFailureType(): String {
1515 RouterErrorType .AUTHENTICATION_ERROR -> RouterFailureType .AUTHENTICATION_ERROR
1616 RouterErrorType .ROUTE_CREATION_ERROR -> RouterFailureType .ROUTE_CREATION_ERROR
1717 RouterErrorType .REQUEST_CANCELLED -> error(" Should have been processed separately" )
18- RouterErrorType .MAP_MATCHING_CREATION_ERROR ->
19- RouterFailureType .ROUTE_CREATION_ERROR
18+ RouterErrorType .MAP_MATCHING_CREATION_ERROR -> RouterFailureType . ROUTE_CREATION_ERROR
19+ RouterErrorType . MISSING_TILES_ERROR -> RouterFailureType .MISSING_TILES_ERROR
2020 }
2121}
Original file line number Diff line number Diff line change @@ -1421,6 +1421,30 @@ class RouterWrapperTests {
14211421 }.build()
14221422 }
14231423
1424+ @Test
1425+ fun `route request missing tiles error` () =
1426+ coroutineRule.runBlockingTest {
1427+ routerWrapper.getRoute(routerOptions, signature, navigationRouterCallback)
1428+ getRouteSlot.captured.run (
1429+ ExpectedFactory .createError(
1430+ listOf (
1431+ createRouterError(
1432+ type = RouterErrorType .MISSING_TILES_ERROR ,
1433+ ),
1434+ ),
1435+ ),
1436+ nativeOriginOnboard,
1437+ )
1438+
1439+ val failures = slot<List <RouterFailure >>()
1440+ verify(exactly = 1 ) {
1441+ navigationRouterCallback.onFailure(capture(failures), routerOptions)
1442+ }
1443+ val failure: RouterFailure = failures.captured[0 ]
1444+ assertFalse(failure.isRetryable)
1445+ assertEquals(RouterFailureType .MISSING_TILES_ERROR , failure.type)
1446+ }
1447+
14241448 private companion object {
14251449
14261450 private const val CANCELLED_MESSAGE = " Cancelled"
You can’t perform that action at this time.
0 commit comments