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
feat: Allow crash reporting to use event mappers #1742
Conversation
CrashReportReceiver now supports calling both the view and event mapper before writing the crash to storage. refs: RUM-2206
f2f8e9a
to
0adfeb2
Compare
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 one suggestion, non-blocking. LMK what we decide on the possibility of dropping crashes from mapper.
Also, please update CHANGELOG.md
🙏
DatadogCore/Tests/Datadog/RUM/Integrations/CrashReportReceiverTests.swift
Outdated
Show resolved
Hide resolved
This is partially to prevent users from accidentally dropping fatal errors in their mappers, and partially to be consistent with Android.
d72d7db
to
5b60c64
Compare
Datadog ReportBranch report: ✅ 0 Failed, 2699 Passed, 0 Skipped, 22m 51.24s Wall Time 🔻 Code Coverage Decreases vs Default Branch (12)
|
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.
🎯 Well integrated 🔗. I left two minor comments.
* [FEATURE] Call RUM's `errorEventMapper` for crashes. | ||
* [FEATURE] Support calling log event mapper for crashes. |
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/ Let's add PR references to both to be consistent with the rest of this file. It helps when generating release notes and later when tracking changes.
writer.write(value: rumError) | ||
if let mappedError = self.eventsMapper.map(event: rumError) { | ||
writer.write(value: mappedError) | ||
} |
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.
question/ Why do we allow dropping crash in this mapper call? Seems inconsistent with the next crash write in this file. Is it because in this case it goes without corresponding view event? If it's on purpose, I think it may make sense to add code comment on this decision.
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.
No it's not on purpose. I'll make sure the test covers this and fix.
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.
@fuzzybinary I updated this branch with git conflicts resolution after my merge of #1750. It should be all fine now 👍.
The notable change is that from #1750 all RUM components (including CrashReportReceiver
) depend on FeatureScope
instead of DatadogCoreProtocol
. That removes the use of PassthroughCoreMock
in all RUM unit tests, replacing them with simpler FeatureScopeMock
. This achieves goals outlined in #1744
# Conflicts: # DatadogCore/Tests/Datadog/Mocks/RUMFeatureMocks.swift # DatadogRUM/Sources/Feature/RUMFeature.swift # DatadogRUM/Sources/Integrations/CrashReportReceiver.swift # DatadogRUM/Tests/Mocks/RUMFeatureMocks.swift
7a401aa
to
2d5d2d2
Compare
receiver.receive(message: .baggage( | ||
key: MessageBusSender.MessageKeys.crash, | ||
value: MessageBusSender.Crash(report: crashReport, context: crashContext) | ||
), from: core) |
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.
This doesn't compile. With my latest changes on develop
, we should now test against FeatureScopeMock
not the core
. See surrounding tests in this file, I updated them this morning.
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.
Ugh, sorry, pulled and rebased and didn't see any conflicts so assumed it was good. Fixed now.
faf4c70
to
7d0ee48
Compare
What and why?
CrashReportReceiver now supports calling both the view and event mapper before writing the crash to storage.
refs: RUM-2206
Review checklist
Custom CI job configuration (optional)
tools/