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

Fix date decoding error #140

Merged
merged 4 commits into from
May 5, 2021
Merged

Conversation

avsadyryn
Copy link
Contributor

There was frequently an error Failed to decode response. This fix should help, at least after a month of observing I didn't see that error appeared again.

@avsadyryn avsadyryn requested a review from AvdLee as a code owner May 4, 2021 09:31
let formatter = DateFormatter()
formatter.locale = Locale(identifier: "en_US_POSIX")
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.calendar = Calendar(identifier: .iso8601)
Copy link
Owner

Choose a reason for hiding this comment

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

Wouldn't it be enough to set this calendar? Do we really need the timezone and locale setting?

Copy link
Contributor Author

@avsadyryn avsadyryn May 4, 2021

Choose a reason for hiding this comment

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

If we set only the calendar parameter, then locale and timeZone will stay by default (according to the user iOS Settings). And for ISO8601-like DateFormatter it's expected en_US_POSIX locale and GMT timeZone. I think it would be more stable that way.

Copy link
Owner

Choose a reason for hiding this comment

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

Alright, makes sense! Thanks for the detailed explanation 🙂

@SwiftLeeBot
Copy link
Collaborator

Messages
📖

View more details on Bitrise

📖 AppStoreConnect-Swift-SDK: Executed 168 tests, with 0 failures (0 unexpected) in 1.039 (1.604) seconds

AppStoreConnect_Swift_SDK.framework: Coverage: 80.82

File Coverage
APIProvider.swift 87.34%

Generated by 🚫 Danger Swift against 560389c

@AvdLee AvdLee merged commit 1eba31c into AvdLee:master May 5, 2021
@SwiftLeeBot
Copy link
Collaborator

Congratulations! 🎉 This was released as part of Release 1.5.0 🚀

Generated by GitBuddy

@avsadyryn avsadyryn deleted the bugfix/date-decoding-error branch April 10, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants