Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to MapboxMaps v10.4.0-rc.1, MapboxNavigationNative v92.0.0. #3765

Merged
merged 26 commits into from
Mar 18, 2022

Conversation

MaximAlien
Copy link
Contributor

@MaximAlien MaximAlien commented Feb 25, 2022

PR updates dependencies to:

  • Mapbox Maps v10.4.0-rc.1.
  • Mapbox Navigation Native v92.0.0.
  • Mapbox Direction v2.4.0-beta.1.

@MaximAlien MaximAlien added the build Issues related to builds and dependency management. label Feb 25, 2022
@MaximAlien MaximAlien added this to the v2.4 milestone Feb 25, 2022
@MaximAlien MaximAlien requested a review from a team February 25, 2022 02:25
@MaximAlien MaximAlien self-assigned this Feb 25, 2022
@MaximAlien
Copy link
Contributor Author

MaximAlien commented Feb 25, 2022

For now we cannot fully update, because of such error:

error: Dependencies could not be resolved because root depends on 'mapbox-navigation-native-ios' 88.0.0..<89.0.0 and root depends on 'mapbox-maps-ios' 10.4.0-beta.1.
'mapbox-maps-ios' is incompatible with 'mapbox-navigation-native-ios' because 'mapbox-maps-ios' >= 10.4.0-beta.1 depends on 'mapbox-common-ios' 21.2.0-beta.1 and 'mapbox-navigation-native-ios' >= 88.0.0 depends on 'mapbox-common-ios' 21.1.0..<22.0.0.

New Mapbox Navigation Native release that contains Mapbox Common v21.2.0-beta.1 will be required.

@MaximAlien MaximAlien added the blocked Blocked by dependency or unclarity. label Feb 25, 2022
@MaximAlien MaximAlien force-pushed the maxim/update-dependencies branch from 773fcf3 to 11b8b7b Compare March 4, 2022 17:01
@MaximAlien MaximAlien removed the blocked Blocked by dependency or unclarity. label Mar 4, 2022
@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@1ec5 1ec5 self-assigned this Mar 11, 2022
@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@1ec5
Copy link
Contributor

1ec5 commented Mar 11, 2022

The tests pass and turn-by-turn navigation seems to work at first, but route refreshing crashes:

#6	0x00000001038561f0 in closure #1 in InternalRouter<>.refreshRoute(from:legIndex:completion:) at /path/to/mapbox-navigation-ios/Sources/MapboxCoreNavigation/Router.swift:245
#7	0x00000001038576e2 in partial apply for closure #1 in InternalRouter<>.refreshRoute(from:legIndex:completion:) ()
#8	0x00000001037f7a54 in closure #1 in closure #2 in MapboxRoutingProvider.refreshRoute(indexedRouteResponse:fromLegAtIndex:completionHandler:) at /path/to/mapbox-navigation-ios/Sources/MapboxCoreNavigation/MapboxRoutingProvider.swift:316
#9	0x00000001037f4052 in closure #4 in MapboxRoutingProvider.parseResponse<τ_0_0>(requestId:userInfo:result:completion:) at /path/to/mapbox-navigation-ios/Sources/MapboxCoreNavigation/MapboxRoutingProvider.swift:193
#10	0x00000001037f1a1b in closure #1 in MapboxRoutingProvider.complete(requestId:with:) at /path/to/mapbox-navigation-ios/Sources/MapboxCoreNavigation/MapboxRoutingProvider.swift:135
2022-03-11 11:39:53.715232-0800 Example[5739:6593064] nav-native Directions Service: Route refresh request: https://api.mapbox.com/directions-refresh/v1/mapbox/driving-traffic/q1eNQbJc0vTl3bl_VkecBfeUlIQOU1t0P0Y_8dfnnNL9pVqzM2AOVQ==/0/0?access_token=****_9cg
2022-03-11 11:39:53.962849-0800 Example[5739:6598689] nav-native Directions Service: Route refresh response: {"code":"Ok","route":{"legs":[{"annotation":{"maxspeed":[{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"speed":32,"unit":"km/h"},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"}],"congestion_numeric":[null,null,null,null,null,null,0,0,0,17,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,8,1,1,1,1,1],"duration":[1.902,2.537,1.844,1.591,1.818,1.657,3.154,5.047,5.047,1.256,0.993,0.61,0.701,0.637,0.839,0.688,0.776,5.155,0.794,0.792,0.86,0.903,0.85,1.027,1.096,1.158,1.356,2.122,0.787,0.97,1.202,1.233,0.937,1.216,0.987,1.185,0.799,0.526,1.047,1.083,1.124,0.528,0.631,0.406,0.452,2.978,3.31,0.593,0.472,0.514,0.526,0.581,0.681,0.729,0.709,0.565,0.536,0.481,0.418,0.361,0.416,0.506,0.368,0.43,0.492,0.51,0.599,0.607,0.571,0.647,0.803,10.003,1.944,2.123,10.426,0.319,5.23,1.177,2.224,0.205]}},{"annotation":{"maxspeed":[{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"},{"speed":89,"unit":"km/h"}],"congestion_numeric":[1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0],"duration":[0.952,4.67,12.393,5.822,3.187,4.556,4.151,4.176,0.694,4.233,3.512,2.756,2.75,0.65,0.628,0.445,0.529,0.454,0.387,0.946,0.634,0.607,0.588,0.663,0.594,0.434,0.727,0.592,0.676,0.611,0.886,0.815,0.629,0.59,0.661,1.896,1.895,0.506,0.68,3.558,4.666,13.735,3.568,2.888,4.936,6.323,1.679,5.846,0.382]}}]}}
MapboxCoreNavigation/Router.swift:245: Fatal error: Refreshed `RouteResponse` did not contain required `routeIndex`!
2022-03-11 11:39:54.129591-0800 Example[5739:6592515] MapboxCoreNavigation/Router.swift:245: Fatal error: Refreshed `RouteResponse` did not contain required `routeIndex`!

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

Comment on lines 259 to 264
// Based on MBNNRouteIndex.routeId documentation.
// FIXME: Distinguish onboard routes with “local@” prefix.
let routeResponseIdentifier = indexedRouteResponse.routeResponse.identifier ?? ""
let routeIndices = (indexedRouteResponse.routeResponse.routes ?? []).enumerated().map { index, route in
RouteIndex(routeId: "\(routeResponseIdentifier)#\(index)", indexInResponse: UInt32(index))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This route identifier generation code is problematic. The format is hardcoded here based on a documentation comment buried deep in MapboxNavigationNative. There doesn’t seem to be a way to distinguish a remote route from a local route. That was previously by design. We probably need MapboxDirections to persist unrecognized properties in order to have access to the route identifier that the navigator expects: mapbox/mapbox-directions-swift#637. Or is there some other way for this method to determine the source of the route?

/cc @Udumft @SiarheiFedartsou

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We introduced Routes.parse API on our side - we will encapsulate this logic there. I tagged you in that PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +63 to +64
// TODO: Is it safe to set the leg index to 0 when unsetting a route?
setRoutes(nil, 0, completion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to set the leg index to 0 when unsetting a route? If not, what should the leg index be in this case?

Comment on lines +216 to +217
func unsetRoutes(uuid: UUID, completion: @escaping (Result<RouteInfo, Error>) -> Void) {
routeCoordinator.endActiveNavigation(with: uuid, completion: completion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I broke out a separate method for unsetting the route, because more than one parameter has different expected values, and the implementation ends up being totally different.

@1ec5 1ec5 removed their assignment Mar 11, 2022
@1ec5 1ec5 force-pushed the maxim/update-dependencies branch 2 times, most recently from e4a6406 to 2bcd189 Compare March 11, 2022 22:49
@1ec5 1ec5 changed the title Update dependencies. Upgrade to MapboxMaps v10.4.0-beta.1, MapboxNavigationNative v90.0.0 Mar 11, 2022
@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation


sharedNavigator.setRoutes(routes, uuid: sessionUUID) { result in
sharedNavigator.setRoutes(navigationRoutes, uuid: sessionUUID, legIndex: UInt32(progress.legIndex)) { result in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a know issue about setting not first route as primary which results in crash inside NN. Upcoming NN v91 should fix that, as these route handling methods are reworked

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

request: routeRequest)
if parsedRoutes.isValue(),
let route = (parsedRoutes.value as? [RouteInterface])?.first {
self.sharedNavigator.setRoutes(route, uuid: self.sessionUUID, legIndex: UInt32(progress.legIndex)) { result in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to call setRoutes on background queue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I’m not mistaken, the expectation is that we’d continue to call this method on the main queue despite calling parseDirectionsResponse(forResponse:) on a background queue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Navigator is thread-safe(at least it should be), i.e. you can call this method from any thread. The only thing to note is that callbacks will be called on a thread where Navigator was created.

Copy link
Contributor

@Udumft Udumft Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callbacks will be called on a thread where Navigator was created.

So there's not need to explicitly call main thread for the callbacks here (we create Navigator on strictly Main). Will update it

CHANGELOG.md Show resolved Hide resolved
@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

NavigationRouteOptions

  • removed method: init(locations:profileIdentifier:) in NavigationRouteOptions
  • removed method: init(waypoints:profileIdentifier:) in NavigationRouteOptions
  • removed method: init(coordinates:profileIdentifier:) in NavigationRouteOptions

NavigationMatchOptions

  • removed method: init(coordinates:profileIdentifier:) in NavigationMatchOptions
  • removed method: init(locations:profileIdentifier:) in NavigationMatchOptions
  • removed method: init(waypoints:profileIdentifier:) in NavigationMatchOptions

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

NavigationMatchOptions

  • removed method: init(waypoints:profileIdentifier:) in NavigationMatchOptions
  • removed method: init(coordinates:profileIdentifier:) in NavigationMatchOptions
  • removed method: init(locations:profileIdentifier:) in NavigationMatchOptions

NavigationRouteOptions

  • removed method: init(locations:profileIdentifier:) in NavigationRouteOptions
  • removed method: init(waypoints:profileIdentifier:) in NavigationRouteOptions
  • removed method: init(coordinates:profileIdentifier:) in NavigationRouteOptions

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Breaking Changes in MapboxCoreNavigation

Breaking API Changes

NavigationRouteOptions

  • removed method: init(waypoints:profileIdentifier:) in NavigationRouteOptions
  • removed method: init(locations:profileIdentifier:) in NavigationRouteOptions
  • removed method: init(coordinates:profileIdentifier:) in NavigationRouteOptions

NavigationMatchOptions

  • removed method: init(waypoints:profileIdentifier:) in NavigationMatchOptions
  • removed method: init(locations:profileIdentifier:) in NavigationMatchOptions
  • removed method: init(coordinates:profileIdentifier:) in NavigationMatchOptions

@mapbox-github-ci-issues-public-1

No breaking changes detected in MapboxNavigation

@Udumft
Copy link
Contributor

Udumft commented Mar 18, 2022

Breaking changes bot is complaining because listed methods have new argument with a default value. It will not lead to any code updates on user side to adopt this version.

@@ -17,11 +17,13 @@ open class NavigationRouteOptions: RouteOptions, OptimizedForNavigation {

- seealso: `RouteOptions`
*/
public required init(waypoints: [Waypoint], profileIdentifier: ProfileIdentifier? = .automobileAvoidingTraffic) {
public required init(waypoints: [Waypoint], profileIdentifier: ProfileIdentifier? = .automobileAvoidingTraffic, queryItems: [URLQueryItem]? = nil) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don’t need to mention this in the changelog, since it’s just an override of the RouteOptions initializer in MapboxDirections, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think so

@@ -333,7 +333,7 @@ class NavigationViewControllerTests: TestCase {
newRouteResponse.identifier)
}

func testPuck3DLayerPosition() {
func disabled_testPuck3DLayerPosition() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s track reenabling this test in a separate issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bamx23 bamx23 merged commit f8198e3 into main Mar 18, 2022
@bamx23 bamx23 deleted the maxim/update-dependencies branch March 18, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to builds and dependency management.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants