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

Removed non-thread safe date formatter #758

Merged
merged 1 commit into from
Jul 20, 2020
Merged

Conversation

tomlongridge
Copy link
Contributor

@tomlongridge tomlongridge commented Jul 20, 2020

Goal

Fixes potential SIGABRT in shared date formatter object - all code now makes use of the thread-safe version (BSG_RFC3339DateTool) that creates an instance per thread.

Changeset

  • BSG_RFC3339DateTool.m → Bugsnag/Helpers/BSG_RFC3339DateTool.m - moved location as it's now used throughout repo
  • BSG_RFC3339DateTool.m - added a fallback date formatter instance for parsing date strings with a timezone ("+XXXX") as this format was in use in Bugsnag.payloadDateFormatter and so will existing in persisted reports.
  • Bugsnag/Bugsnag.m - removed payloadDateFormatter
  • Bugsnag/BSGOutOfMemoryWatchdog.m - switched out Bugsnag.payloadDateFormatter for BSG_RFC3339DateTool
  • Bugsnag/Client/BugsnagClient.m - switched out Bugsnag.payloadDateFormatter for BSG_RFC3339DateTool
    Bugsnag/Payload/BugsnagBreadcrumb.m - switched out Bugsnag.payloadDateFormatter for BSG_RFC3339DateTool
    Bugsnag/Payload/BugsnagDeviceWithState.m - - switched out Bugsnag.payloadDateFormatter for BSG_RFC3339DateTool

Tests

  • Additional and amended unit tests to verify change of date parsing behaviour.
  • Manually tested that times look correct on dashboard, including a report generated from current-live code (i.e. with timezones)

Now using BSG_RFC3339DateTool for all date parsing.

This also includes a BC fix to ensure we can read
existing reports with timezones.
@tomlongridge tomlongridge force-pushed the tom/fix-date-formatting branch from 48caf5a to a295190 Compare July 20, 2020 14:42
@tomlongridge tomlongridge changed the base branch from master to next July 20, 2020 14:42
@tomlongridge tomlongridge merged commit 9082772 into next Jul 20, 2020
@tomlongridge tomlongridge deleted the tom/fix-date-formatting branch July 20, 2020 16:40
@tomlongridge tomlongridge mentioned this pull request Jul 24, 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