CI: run tests on iOS 11#2036
Closed
NachoSoto wants to merge 3 commits into
Closed
Conversation
88e7063 to
4e4e608
Compare
4e4e608 to
01fd4e8
Compare
b5a01f9 to
504b842
Compare
Contributor
Author
|
I'm testing with Xcode 13.0.0 (which technically we don't support), and we still can't install an iOS 11 simulator :( |
NachoSoto
added a commit
that referenced
this pull request
Nov 8, 2022
Fixes [TRIAGE-172] See stacktrace: ``` Fatal Exception: NSInternalInconsistencyException Invalid parameter not satisfying: formatOptions == 0 || !(formatOptions & ~(NSISO8601DateFormatWithYear | NSISO8601DateFormatWithMonth | NSISO8601DateFormatWithWeekOfYear | NSISO8601DateFormatWithDay | NSISO8601DateFormatWithTime | NSISO8601DateFormatWithTimeZone | NSISO8601DateFormatWithSpaceBetweenDateAndTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithColonSeparatorInTimeZone | NSISO8601DateFormatWithFullDate | NSISO8601DateFormatWithFullTime | NSISO8601DateFormatWithInternetDateTime)) Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x141d04 __exceptionPreprocess 1 libobjc.A.dylib 0x8528 objc_exception_throw 2 CoreFoundation 0x141bd8 +[NSException raise:format:] 3 Foundation 0xacc24 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 4 Foundation 0xe4794 -[NSISO8601DateFormatter setFormatOptions:] 5 RevenueCat 0x4795c one-time initialization function for withMilliseconds 6 libdispatch.dylib 0x1048 _dispatch_client_callout 7 libdispatch.dylib 0x4710 dispatch_once_f$VARIANT$mp 8 RevenueCat 0x47b0c date(from:) in Formatter #1 in closure #1 in variable initialization expression of static NSISO8601DateFormatter.default + 60 (DateFormatter+Extensions.swift:60) 9 RevenueCat 0x47b68 protocol witness for DateFormatterType.date(from:) in conformance Formatter #1 in closure #1 in variable initialization expression of static NSISO8601DateFormatter.default (<compiler-generated>) 10 RevenueCat 0xe6b8 AppleReceiptBuilder.build(fromContainer:) (AppleReceiptBuilder.swift) ``` This is the key part: `formatOptions == 0 || !(formatOptions & ~(NSISO8601DateFormatWithYear | NSISO8601DateFormatWithMonth | NSISO8601DateFormatWithWeekOfYear | NSISO8601DateFormatWithDay | NSISO8601DateFormatWithTime | NSISO8601DateFormatWithTimeZone | NSISO8601DateFormatWithSpaceBetweenDateAndTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithColonSeparatorInTimeZone | NSISO8601DateFormatWithFullDate | NSISO8601DateFormatWithFullTime | NSISO8601DateFormatWithInternetDateTime))` This is coming from the following code: ```swift static let withMilliseconds: DateFormatterType = { let formatter = ISO8601DateFormatter() formatter.formatOptions = [ .withInternetDateTime, .withFractionalSeconds ] return formatter }() ``` Even though `.withFractionalSeconds` is available in iOS 11, that assertion seems wrong, as it's treating that option as invalid. This was a regression in #998, almost a year ago, but since we have very little coverage on iOS 11 we never noticed until now. Unfortunately it seems like we won't be able to run iOS 11 tests in CI (#2036), but this change is fairly safe, it just reverts to using the old `DateFormatter` for older versions. [TRIAGE-172]: https://revenuecats.atlassian.net/browse/TRIAGE-172?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We support iOS 11, so we should make sure tests pass there too.