-
Notifications
You must be signed in to change notification settings - Fork 315
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
Conversation
For now we cannot fully update, because of such error:
New Mapbox Navigation Native release that contains Mapbox Common |
773fcf3
to
11b8b7b
Compare
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
The tests pass and turn-by-turn navigation seems to work at first, but route refreshing crashes:
|
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
// 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)) | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @DenisPryt
// TODO: Is it safe to set the leg index to 0 when unsetting a route? | ||
setRoutes(nil, 0, completion) |
There was a problem hiding this comment.
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?
func unsetRoutes(uuid: UUID, completion: @escaping (Result<RouteInfo, Error>) -> Void) { | ||
routeCoordinator.endActiveNavigation(with: uuid, completion: completion) |
There was a problem hiding this comment.
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.
e4a6406
to
2bcd189
Compare
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
|
||
sharedNavigator.setRoutes(routes, uuid: sessionUUID) { result in | ||
sharedNavigator.setRoutes(navigationRoutes, uuid: sessionUUID, legIndex: UInt32(progress.legIndex)) { result in |
There was a problem hiding this comment.
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
No breaking changes detected in MapboxCoreNavigation |
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
No breaking changes detected in MapboxCoreNavigation |
No breaking changes detected in MapboxNavigation |
Breaking Changes in MapboxCoreNavigationBreaking API Changes
|
No breaking changes detected in MapboxNavigation |
Breaking Changes in MapboxCoreNavigationBreaking API Changes
|
No breaking changes detected in MapboxNavigation |
Breaking Changes in MapboxCoreNavigationBreaking API Changes
|
No breaking changes detected in MapboxNavigation |
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR updates dependencies to:
v10.4.0-rc.1
.v92.0.0
.v2.4.0-beta.1
.