-
Notifications
You must be signed in to change notification settings - Fork 133
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-2997] Send a crash to both RUM and Logging features #1209
[RUMM-2997] Send a crash to both RUM and Logging features #1209
Conversation
6d7790c
to
1897e65
Compare
Datadog ReportBranch report: ✅ |
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.
Looks great 🎯👌 - I left minor feedback, but for me it's good to go, anyway.
@@ -12,7 +12,7 @@ class CrashReporterTests: XCTestCase { | |||
// MARK: - Sending Crash Report | |||
|
|||
func testWhenPendingCrashReportIsFound_itIsSentAndPurged() throws { | |||
let expectation = self.expectation(description: "`LoggingOrRUMsender` sends the crash report") | |||
let expectation = self.expectation(description: "`LoggingAndRUMsender` sends the crash report") |
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.
nit/ it seems to be an artifact of V2 refactoring - neither LoggingOrRUMsender
nor LoggingAndRUMsender
do exist and instead we use CrashReportSender
.
let expectation = self.expectation(description: "`LoggingAndRUMsender` sends the crash report") | |
let expectation = self.expectation(description: "`CrashReportSender` sends the crash report") |
@@ -46,6 +46,47 @@ class CrashReporterTests: XCTestCase { | |||
XCTAssertTrue(plugin.hasPurgedCrashReport == true, "It should ask to purge the crash report") | |||
} | |||
|
|||
func testWhenPendingCrashReportIsFound_itIsSentBothToRumAndLogs() throws { | |||
let expectation = self.expectation(description: "`LoggingAndRUMsender` sends the crash report to both features") |
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.
let expectation = self.expectation(description: "`LoggingAndRUMsender` sends the crash report to both features") | |
let expectation = self.expectation(description: "`CrashReportSender` sends the crash report to both features") |
@@ -74,7 +115,7 @@ class CrashReporterTests: XCTestCase { | |||
} | |||
|
|||
func testWhenPendingCrashReportIsFoundButItHasUnavailableCrashContext_itPurgesTheCrashReportWithNoSending() { | |||
let expectation = self.expectation(description: "`LoggingOrRUMsender` does not send the crash report") | |||
let expectation = self.expectation(description: "`LoggingAndRUMsender` does not send the crash report") |
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.
let expectation = self.expectation(description: "`LoggingAndRUMsender` does not send the crash report") | |
let expectation = self.expectation(description: "`CrashReportSender` does not send the crash report") |
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.
Great work 👍 another approach would be to send a single "crash" message on the bus, and make the Logs Feature consume that one instead of "crash-log". It would simplify a bit the implementation, but it would have to print a more generic warning if the crash is not consumed at all.
I can also do that if you prefer. It depends if we want to give importance to the fact that the crash is consumed by a specific feature, or by any feature. |
1897e65
to
f575c72
Compare
Yes, I am for simplicity :) I think we would benefit from sending the crash only once on the bus, mostly because it will save an encode/decode operation on the message-bus and it could be consume by any Feature. Also, this warning won't have much visibility as it will be printed when the app restart only. |
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.
Nice, thank you!
What and why?
Sends crash information both to Logs and RUM Features, as opposed to only RUM if both features are enabled.
Adopted a logging strategy similar to Android.
How?
A brief description of implementation details of this PR.
Review checklist
Custom CI job configuration (optional)