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

RUMM-494 Add milliseconds precision on iOS 11.0 and 11.1 #130

Merged

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Jun 9, 2020

What and why?

📦 To mitigate production impact of #126 we sacrificed the millisecond precision on iOS11.0 and 11.1, as the ISO8601DateFormatter 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 different DateFormaterType implementations for date encoding:

  • ISO8601DateFormatter for iOS11.2+,
  • DateFormatter for iOS11.0 and iOS11.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 the timeZone argument for time formatting:

Screenshot 2020-06-09 at 18 08 39

In result, all the dates were formatted with UTC timezone:

Screenshot 2020-06-09 at 13 19 38

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:

11:00:00.001+01:00

for UTC+1, or:

10:00:00.001Z

for UTC. That's why the DateFormatter API is used for user-facing dates formatting.

Fixing tests execution on iOS 11.1 and iOS 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 and 13.5 Simulators. With RUMM-486 we will further ensure we execute them on daily basis for all supported OS versions.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

@ncreated ncreated added this to the next-version milestone Jun 9, 2020
@ncreated ncreated self-assigned this Jun 9, 2020
@ncreated ncreated marked this pull request as ready for review June 9, 2020 16:20
@ncreated ncreated requested a review from a team as a code owner June 9, 2020 16:20
Copy link
Contributor

@buranmert buranmert left a comment

Choose a reason for hiding this comment

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

lack of timezone in presentation was a good catch 👏

@ncreated ncreated merged commit 1e84928 into master Jun 10, 2020
@ncreated ncreated deleted the ncreated/RUMM-494-add-milliseconds-precision-on-ios-11.1 branch June 10, 2020 09:23
@ncreated ncreated removed this from the next-version milestone Jun 19, 2020
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.

2 participants