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

Update Mapbox Maps SDK dependency to v10.0.0-beta.19.1. #2983

Merged
merged 18 commits into from
May 13, 2021

Conversation

MaximAlien
Copy link
Contributor

@MaximAlien MaximAlien commented May 6, 2021

Description

Updated Mapbox Maps SDK dependency to v10.0.0-beta.19.1.

Also fixes:

@MaximAlien MaximAlien added the build Issues related to builds and dependency management. label May 6, 2021
@MaximAlien MaximAlien added this to the v2.0.0 (RC) milestone May 6, 2021
@MaximAlien MaximAlien requested a review from a team May 6, 2021 15:02
@MaximAlien MaximAlien self-assigned this May 6, 2021
@MaximAlien MaximAlien marked this pull request as draft May 6, 2021 15:02
@MaximAlien MaximAlien changed the title Update dependencies. Update to the latest changes in Mapbox Maps SDK. May 6, 2021
@MaximAlien MaximAlien changed the title Update to the latest changes in Mapbox Maps SDK. Update Mapbox Maps SDK dependency to v10.0.0-beta.19. May 7, 2021
MaximAlien added 4 commits May 7, 2021 09:30
# Conflicts:
#	Sources/MapboxNavigation/ArrivalController.swift
#	Sources/MapboxNavigation/CameraController.swift
#	Sources/MapboxNavigation/NavigationMapView.swift
# Conflicts:
#	Sources/MapboxNavigation/OrnamentsController.swift
#	Tests/CocoaPodsTest/PodInstall/Podfile.lock
@MaximAlien MaximAlien changed the title Update Mapbox Maps SDK dependency to v10.0.0-beta.19. Update Mapbox Maps SDK dependency to v10.0.0-beta.19.1. May 10, 2021
@MaximAlien MaximAlien linked an issue May 10, 2021 that may be closed by this pull request
@MaximAlien MaximAlien marked this pull request as ready for review May 10, 2021 10:23
@MaximAlien MaximAlien requested a review from avi-c May 12, 2021 07:49
Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

My only concern is how we’re dealing with runtime styling errors. There wouldn’t be any harm from landing the PR as is, since previous map SDK releases would’ve given us no opportunity to react to these failures anyways. But log statements in general are a pretty weak error handling mechanism, given all the console spew that the SDK and its dependencies already put out.

Comment on lines 149 to 151
navigationMapView.mapView.update {
$0.location.puckType = .puck2D()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This effectively moves the change in puck to loadView(). I think that’s OK, but I’m also unclear on why we have map configuration going on in loadView() instead of viewDidLoad() or viewWillLoad(). It seems that has been the case since 346e6c1 for #1709, so I guess that’s OK.

layer.paint?.lineColor = .constant(.init(color: styledFeature.color))
try navigationMapView.mapView.style.addLayer(layer)
} catch {
NSLog("Failed to perform operation with error: \(error.localizedDescription).")
Copy link
Contributor

Choose a reason for hiding this comment

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

There are log statements in response to runtime styling errors throughout this PR. Is this is a best practice, or should we do something more aggressive like asserting or rethrowing? How likely are these errors?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the past I've been frustrated by how fatal the Maps SDK treats things like adding a duplicate style identifier, etc. so I would have liked to see this kind of non-fatal error logging.

That said, it might be useful to make these errors more fatal at least for this period when the Maps SDK v10 is still in beta. it might help us to catch issues in the SDK that might otherwise slip by unnoticed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about keeping those log statements to see if there are any issues during development process in runtime styling, when our styling logic is more stable we can probably remove it. Also as @avi-c found we currently have some errors already, so it'd be good to create a ticket to tackle those.

Comment on lines +1132 to +1134
if let expressionData = expressionString.data(using: .utf8),
let expJSONObject = try? JSONSerialization.jsonObject(with: expressionData, options: []) {
mapView.mapboxMap.__map.setStyleLayerPropertyForLayerId(routeDurationAnnotationsLayerIdentifier,
Copy link
Contributor

Choose a reason for hiding this comment

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

#2996 will simplify a lot of the code in this method by using the map SDK’s usual runtime styling APIs.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should address and land #2996 as quickly as we can, but it is currently blocked by the Maps SDK.

Sources/MapboxNavigation/OrnamentsController.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@avi-c avi-c left a comment

Choose a reason for hiding this comment

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

I verified that the Route Duration feature still works, so from that perspective it looks good, however, I am seeing a bunch of errors/warnings logged to the console if I run the Example app and long press to go into route preview mode. They have this form:

2021-05-12 10:17:04.942581-0700 Example[84268:5959937] Failed to perform operation on MapboxNavigation-MapboxNavigation-resourcesbuildingExtrusionLayer with error: Layer MapboxNavigation-MapboxNavigation-resourcesbuildingExtrusionLayerdoes not exist.
2021-05-12 10:17:05.098531-0700 Example[84268:5959937] Failed to remove layer MapboxNavigation-MapboxNavigation-resources_waypointCircleLayer with error: Layer MapboxNavigation-MapboxNavigation-resources_waypointCircleLayerdoes not exist.
2021-05-12 10:17:05.098779-0700 Example[84268:5959937] Failed to remove layer MapboxNavigation-MapboxNavigation-resources_waypointSymbolLayer with error: Layer MapboxNavigation-MapboxNavigation-resources_waypointSymbolLayerdoes not exist.
2021-05-12 10:17:05.098981-0700 Example[84268:5959937] Failed to remove source MapboxNavigation-MapboxNavigation-resources_waypointSource with error: Source MapboxNavigation-MapboxNavigation-resources_waypointSource is in use, cannot remove.

2021-05-12 10:17:05.111996-0700 Example[84268:5959937] Failed to add route casing source 0x000060000388fa00.main.source_casing with error: Source 0x000060000388fa00.main.source_casing already exists.

2021-05-12 10:17:05.128682-0700 Example[84268:5959937] Failed to remove layer MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsLayer with error: Layer MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsLayerdoes not exist.
2021-05-12 10:17:05.128877-0700 Example[84268:5959937] Failed to remove source MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsSource with error: Source MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsSource is in use, cannot remove.

@MaximAlien
Copy link
Contributor Author

I verified that the Route Duration feature still works, so from that perspective it looks good, however, I am seeing a bunch of errors/warnings logged to the console if I run the Example app and long press to go into route preview mode. They have this form:

2021-05-12 10:17:04.942581-0700 Example[84268:5959937] Failed to perform operation on MapboxNavigation-MapboxNavigation-resourcesbuildingExtrusionLayer with error: Layer MapboxNavigation-MapboxNavigation-resourcesbuildingExtrusionLayerdoes not exist.
2021-05-12 10:17:05.098531-0700 Example[84268:5959937] Failed to remove layer MapboxNavigation-MapboxNavigation-resources_waypointCircleLayer with error: Layer MapboxNavigation-MapboxNavigation-resources_waypointCircleLayerdoes not exist.
2021-05-12 10:17:05.098779-0700 Example[84268:5959937] Failed to remove layer MapboxNavigation-MapboxNavigation-resources_waypointSymbolLayer with error: Layer MapboxNavigation-MapboxNavigation-resources_waypointSymbolLayerdoes not exist.
2021-05-12 10:17:05.098981-0700 Example[84268:5959937] Failed to remove source MapboxNavigation-MapboxNavigation-resources_waypointSource with error: Source MapboxNavigation-MapboxNavigation-resources_waypointSource is in use, cannot remove.

2021-05-12 10:17:05.111996-0700 Example[84268:5959937] Failed to add route casing source 0x000060000388fa00.main.source_casing with error: Source 0x000060000388fa00.main.source_casing already exists.

2021-05-12 10:17:05.128682-0700 Example[84268:5959937] Failed to remove layer MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsLayer with error: Layer MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsLayerdoes not exist.
2021-05-12 10:17:05.128877-0700 Example[84268:5959937] Failed to remove source MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsSource with error: Source MapboxNavigation-MapboxNavigation-resources_routeDurationAnnotationsSource is in use, cannot remove.

Thanks Avi. Warnings/errors will be tackled in separate PR.

@MaximAlien
Copy link
Contributor Author

My only concern is how we’re dealing with runtime styling errors. There wouldn’t be any harm from landing the PR as is, since previous map SDK releases would’ve given us no opportunity to react to these failures anyways. But log statements in general are a pretty weak error handling mechanism, given all the console spew that the SDK and its dependencies already put out.

I agree that logging errors doesn't give end user a chance to react to possible errors. At the same time it's a bit better than silently hiding thrown exceptions. Not sure if re-throwing will help either, functionality like labelling current road feature, adding route line etc is pretty self-contained.

@MaximAlien MaximAlien merged commit 075d63c into release-v2.0 May 13, 2021
@MaximAlien MaximAlien deleted the maxim/update-dependencies branch May 13, 2021 08:55
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.

CarPlayCompassView doesn't work.
4 participants