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

Increase error count by 1 on the view update event following a crash #1145

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ internal struct CrashReportReceiver: FeatureMessageReceiver {
domComplete: original.view.domComplete,
domContentLoaded: original.view.domContentLoaded,
domInteractive: original.view.domInteractive,
error: original.view.error,
error: .init(count: original.view.error.count + 1),
Copy link
Member

Choose a reason for hiding this comment

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

Error model for now only has count, but I think it would be safer to copy object original.view.error and then add 1 to the count (just so it doesn't break when we alter the model).

firstByte: nil,
firstContentfulPaint: original.view.firstContentfulPaint,
firstInputDelay: original.view.firstInputDelay,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class CrashReportReceiverTests: XCTestCase {
)
XCTAssertEqual(sendRUMViewEvent.view.name, lastRUMViewEvent.view.name)
XCTAssertEqual(sendRUMViewEvent.view.url, lastRUMViewEvent.view.url)
XCTAssertEqual(sendRUMViewEvent.view.error.count, lastRUMViewEvent.view.error.count)
XCTAssertEqual(sendRUMViewEvent.view.error.count, lastRUMViewEvent.view.error.count + 1)
XCTAssertEqual(sendRUMViewEvent.view.resource.count, lastRUMViewEvent.view.resource.count)
XCTAssertEqual(sendRUMViewEvent.view.action.count, lastRUMViewEvent.view.action.count)
XCTAssertEqual(
Expand Down Expand Up @@ -616,7 +616,7 @@ class CrashReportReceiverTests: XCTestCase {
XCTAssertTrue(sentRUMView.view.isActive == false, "The view must be marked inactive")
XCTAssertEqual(sentRUMView.view.name, expectedViewName)
XCTAssertEqual(sentRUMView.view.url, expectedViewURL)
XCTAssertEqual(sentRUMView.view.error.count, 0)
XCTAssertEqual(sentRUMView.view.error.count, 1, "The view must increase number of errors by 1")
XCTAssertEqual(sentRUMView.view.resource.count, 0)
XCTAssertEqual(sentRUMView.view.action.count, 0)
XCTAssertEqual(sentRUMView.source, .init(rawValue: randomSource))
Expand Down Expand Up @@ -759,7 +759,7 @@ class CrashReportReceiverTests: XCTestCase {
XCTAssertTrue(sentRUMView.view.isActive == false, "The view must be marked inactive")
XCTAssertEqual(sentRUMView.view.name, expectedViewName)
XCTAssertEqual(sentRUMView.view.url, expectedViewURL)
XCTAssertEqual(sentRUMView.view.error.count, 0)
XCTAssertEqual(sentRUMView.view.error.count, 1, "The view must increase number of errors by 1")
XCTAssertEqual(sentRUMView.view.resource.count, 0)
XCTAssertEqual(sentRUMView.view.action.count, 0)
XCTAssertEqual(
Expand Down