Skip to content

Commit eb7b021

Browse files
stanis-kgithub-actions[bot]
authored andcommitted
Add RouterErrorType.MISSING_TILES_ERROR (#11532)
* Add RouterErrorType.MISSING_TILES_ERROR * Add errors to annotations * Add changelog * Update Common and Maps versions in Dash app * Update mapbox3dLiveNavigation version GitOrigin-RevId: 5701501a345b96ecd7b5d605c509d53ee8a434ba
1 parent 17ecdc6 commit eb7b021

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

base/src/main/java/com/mapbox/navigation/base/route/RouterFailureType.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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
)
1820
annotation 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
*/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Introduce RouterFailureType::MISSING_TILES_ERROR to indicate inability to build a route due to missing routing tiles

gradle/dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ext {
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 = ""

navigation/src/main/java/com/mapbox/navigation/core/internal/router/RouterErrorMapper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

navigation/src/test/java/com/mapbox/navigation/core/internal/router/RouterWrapperTests.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)