Skip to content

Commit

Permalink
Merge pull request #1145 from DataDog/plousada/RUMM-2992/view-error-c…
Browse files Browse the repository at this point in the history
…ount-not-being-incremented

Increase error count by 1 on the view update event following a crash
  • Loading branch information
plousada authored Jan 31, 2023
2 parents 42b5014 + 0e5d401 commit 60bde72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/Datadog/RUM/Integrations/CrashReportReceiver.swift
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),
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

0 comments on commit 60bde72

Please sign in to comment.