-
Notifications
You must be signed in to change notification settings - Fork 121
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
RUM-3461 refactor: Replace core
dependency in RUM with FeatureScope
#1750
RUM-3461 refactor: Replace core
dependency in RUM with FeatureScope
#1750
Conversation
by removing abitrary `core` reference passing
let core = PassthroughCoreMock( | ||
bypassConsentExpectation: expectation(description: "Send Event Bypass Consent"), | ||
messageReceiver: CrashReportReceiver.mockAny() | ||
) | ||
let receiver: CrashReportReceiver = .mockWith(featureScope: featureScope) |
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 is a common pattern in this PR. We change from testing message receivers as part of mocked core to testing them as individual units. 🧽 🧹
Datadog ReportBranch report: ✅ 0 Failed, 2897 Passed, 0 Skipped, 11m 35.08s 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.
Very nice! It's a better separation of concerns 👍
What and why?
📦 Utilizing the change from #1744, this PR updates the whole RUM to depend on
FeatureScope
interface rather thanDatadogCoreProtocol
directly.This will be leveraged in fatal App Hangs monitoring, where
AppHangObserver
will take a dependency onFeatureScope
to access DataStore, Event Write Context and Telemetry.How?
With
FeatureScope
being available during RUM feature registration (#1744), it is now injected into all downstream components in RUM including theMonitor
and all message receivers.Review checklist
Custom CI job configuration (optional)
tools/