-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix broken invalid url handling on iOS 17 #136
Conversation
@@ -103,7 +103,11 @@ extension KlaviyoAPI.KlaviyoRequest { | |||
var url: URL? { | |||
switch endpoint { | |||
case .createProfile, .createEvent, .registerPushToken, .unregisterPushToken: | |||
return URL(string: "\(environment.analytics.apiURL)/\(path)/?company_id=\(apiKey)") | |||
if #available(iOS 17.0, *) { | |||
return URL(string: "\(environment.analytics.apiURL)/\(path)/?company_id=\(apiKey)", encodingInvalidCharacters: false) |
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.
Nice
@@ -19,7 +19,7 @@ jobs: | |||
runs-on: macos-13 | |||
strategy: | |||
matrix: | |||
xcode: ['14.3'] | |||
xcode: ['15.1'] |
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 this change related?
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.
Yeah, since the breaking code is related to a new swift version, he had to update the runner XCode version to access that new swift version.
@ajaysubra assume you won't mind, i updated this against master so we can see if CI 100% is fixed now. |
hm CI is hung on 14.3 tests, which I think you removed. Might have to force-merge this one, maybe those tests are cached or something? |
Thanks for updating with master. You are probably right that GH is caching something. Manually triggered the jobs 🤞🏽 |
Description
In iOS 17 apple changes how url's string initializer works and this was causing one of our tests that validates invalid urls to fail. I reverted the URL initializer to not use the new decoding and sticking with the pre iOS 17 logic of keeping invalid characters from decoding. This is fine since the string we are using the URL initializer is a static one and the idea is to align the code with the tests we had.
Change in iOS 17 for more context.
Check List
Manual Test Plan
Supporting Materials