mapbox-directions-swift icon indicating copy to clipboard operation
mapbox-directions-swift copied to clipboard

[🦟 Bug] Use of Directions.url(forCalculating options: DirectionsOptions, httpMethod: String) -> URL causes crash

Open misterkerry opened this issue 5 years ago • 4 comments

Problem

When using this method resulting URL is normally delivered. But, on occasion the method crashes causing the App leveraging the SDK to crash.

Environment

These crashes are shown in Organizer:

Screen Shot 2020-08-11 at 6 47 59 PM

Recommendation

Line 410, 411, 413 shows 3 forced unwrapped objects that could be part of the problem: These elements can be guarded or error messages send to the App

https://github.com/mapbox/mapbox-directions-swift/blob/160e95110fe52b5f8461fbabe8d9405d16930a43/Sources/MapboxDirections/Directions.swift#L410

misterkerry avatar Aug 11 '20 17:08 misterkerry

cc: @1ec5 @zugaldia

misterkerry avatar Aug 11 '20 17:08 misterkerry

Thanks for the report @misterkerry - do you have any logs that may include parameter values that would help us reliably reproduce this issue?

/cc: @chezzdev

zugaldia avatar Aug 12 '20 17:08 zugaldia

No problem @zugaldia . The link to the Crashlytics log above and will take a user to the logs in firebase. I would have to give access to the investigator.
I can also put a file in an access-only directory. lmk.

misterkerry avatar Aug 13 '20 16:08 misterkerry

Line 410, 411, 413 shows 3 forced unwrapped objects that could be part of the problem

Force-unwrapping here essentially asserts that the URL is a well-formed URL. That most likely means something about the API hostname or query parameters is malformed.

1ec5 avatar Aug 21 '20 20:08 1ec5