-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add Device time of report capture to JSON payload #315
Conversation
features/handled_errors.feature
Outdated
@@ -6,6 +6,7 @@ Scenario: Override errorClass and message from a notifyError() callback | |||
And the request is a valid for the error reporting API | |||
And the exception "errorClass" equals "Bar" | |||
And the exception "message" equals "Foo" | |||
And the payload field "events.0.device.time" is not null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to verify the format of this field and also that it is the current time.
I have updated the mazerunner scenario to check that the field is a timestamp. There's also some coverage in the unit tests for ensuring the timestamp is serialised from the KSCrash field, if that's sufficient? Note: Cocoa mazerunner scenarios still do not work on my machine and this makes it very hard to write/debug scenarios. |
It doesnt look like any tests test that the timestamp is the right time (i.e. within 5 seconds of now). |
I have updated the mazerunner scenario to check that the field is a timestamp within 30s of the current time . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once my comment has been addressed I'm ok for there to be a quick review in the UK and then for this to merge into next.
features/steps/ios_steps.rb
Outdated
Then("the event {string} is within {int} ms of the current timestamp") do |field, threshold_ms| | ||
value = read_key_path(find_request(0)[:body], "events.0.#{field}") | ||
assert_not_nil(value, "Expected a timestamp") | ||
nowMs = Time.now.to_i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are actually seconds so all these times should be updated to be seconds, and the thresholds in tests should be seconds.
features/steps/ios_steps.rb
Outdated
@@ -1,3 +1,5 @@ | |||
require 'date' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You dont use this require.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Goal
Reports may be cached on a device if no network connection is available. In this case, the report may not be delivered for hours, or even days, after the error was originally captured by Bugsnag.
Sending the time at which the report was originally captured allows for timestamps to be normalised. This avoids confusing information similar to the following being shown:
Design
The pipeline normalises timestamps based off the
device.time
field.Changeset
Serialises the time at which the report was generated into the
device.time
payload field.Tests
device.time
in handled/unhandled errorReview
For the submitter, initial self-review:
For the pull request reviewer(s), this changeset has been reviewed for: