RUMM-494 Add milliseconds precision on iOS 11.0 and 11.1 #130
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.
What and why?
📦 To mitigate production impact of #126 we sacrificed the millisecond precision on
iOS11.0
and11.1
, as theISO8601DateFormatter
is buggy in those versions of the OS. This PR makes sure the precision is correct on all supported iOS versions (iOS 11+
).How?
The
#available(iOS 11.2, *)
check is used to produce differentDateFormaterType
implementations for date encoding:ISO8601DateFormatter
foriOS11.2+
,DateFormatter
foriOS11.0
andiOS11.1
.Other things done in this PR
Time zone fix for
.printLogsToConsole(_:usingFormat:.short)
I also noticed that #96 introduced a bug for
.printLogsToConsole(true, usingFormat: .short)
feature, as we no longer consider thetimeZone
argument for time formatting:In result, all the dates were formatted with UTC timezone:
It was not possible to use
ISO8601DateFormatter
for console logs formatting, as it doesn't provide necessary format options to hide the time zone information, producing either:for
UTC+1
, or:for
UTC
. That's why theDateFormatter
API is used for user-facing dates formatting.Fixing tests execution on
iOS 11.1
andiOS 12.4
In order to test the fix, I had to make tests execution on major iOS versions stable. That's why there are few fixes added. I made sure, both unit and integration tests run green on:
11.1
,12.4
and13.5
Simulators. WithRUMM-486
we will further ensure we execute them on daily basis for all supported OS versions.Review checklist