You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #382, sometimes calculate(_:completionHandler:) and calculateRoutes(matching:completionHandler:) call the completion handler on the URLSession delegate queue:
The methods should consistently call the completion handler from a single queue, and we should document which queue that is. Previously, in v0.30.0, these methods always called the completion handler on the main queue:
As it is, a developer doesn’t know whether their completion handler implementation needs to dispatch to the main queue or stay on the current queue. So, for example, a completion handler that presents a UIAlertController would result in a crash like this:
#0 (null) in __exceptionPreprocess ()
#1 (null) in objc_exception_throw ()
#2 (null) in _AssertAutolayoutOnAllowedThreadsOnly ()
#3 (null) in -[NSISEngine withBehaviors:performModifications:] ()
#4 (null) in -[UIView(UIConstraintBasedLayout) _calculatedSystemLayoutSizeFittingSize:withHorizontalFittingPri... ()
#5 (null) in -[UIView(AdditionalLayoutSupport) _systemLayoutSizeFittingSize:withHorizontalFittingPriority:vert... ()
#6 (null) in -[_UIAlertControllerView _minimumSizeForAllActions] ()
#7 (null) in -[_UIAlertControllerView _itemSizeForHorizontalLayout:visualStyleRequiresActionRepresentationToFi... ()
#8 (null) in -[_UIAlertControllerView _canLayOutActionsHorizontally] ()
#9 (null) in -[_UIAlertControllerView _actionLayoutDirectionChanged] ()
#10 (null) in -[_UIAlertControllerView _updateStyleForIdiomChange:] ()
#11 (null) in -[_UIAlertControllerView _setVisualStyle:] ()
#12 (null) in -[UIAlertController loadView] ()
#13 (null) in -[UIViewController loadViewIfRequired] ()
#14 (null) in -[UIViewController view] ()
#15 (null) in -[UIViewController _setPresentationController:] ()
#16 (null) in -[UIViewController _presentViewController:modalSourceViewController:presentationController:animat... ()
#17 (null) in -[UIViewController _presentViewController:withAnimationController:completion:] ()
#18 (null) in __63-[UIViewController _presentViewController:animated:completion:]_block_invoke ()
#19 (null) in -[UIViewController _performCoordinatedPresentOrDismiss:animated:] ()
#20 (null) in -[UIViewController _presentViewController:animated:completion:] ()
#21 (null) in -[UIViewController presentViewController:animated:completion:] ()
/cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered:
As of #382, sometimes
calculate(_:completionHandler:)
andcalculateRoutes(matching:completionHandler:)
call the completion handler on the URLSession delegate queue:mapbox-directions-swift/Sources/MapboxDirections/Directions.swift
Lines 160 to 173 in be90d21
whereas sometimes these methods call the completion handler on the main queue:
mapbox-directions-swift/Sources/MapboxDirections/Directions.swift
Lines 181 to 183 in be90d21
mapbox-directions-swift/Sources/MapboxDirections/Directions.swift
Lines 196 to 198 in be90d21
mapbox-directions-swift/Sources/MapboxDirections/Directions.swift
Lines 200 to 203 in be90d21
The methods should consistently call the completion handler from a single queue, and we should document which queue that is. Previously, in v0.30.0, these methods always called the completion handler on the main queue:
mapbox-directions-swift/Sources/MapboxDirections/MBDirections.swift
Lines 257 to 259 in 65857d1
mapbox-directions-swift/Sources/MapboxDirections/MBDirections.swift
Lines 263 to 265 in 65857d1
As it is, a developer doesn’t know whether their completion handler implementation needs to dispatch to the main queue or stay on the current queue. So, for example, a completion handler that presents a UIAlertController would result in a crash like this:
/cc @mapbox/navigation-ios
The text was updated successfully, but these errors were encountered: