-
Notifications
You must be signed in to change notification settings - Fork 168
[chain-pr 3/10] DatadogCore: CoreMessageBus implementation and rename #2929
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
base: feature/message-bus-subscription
Are you sure you want to change the base?
Changes from all commits
c65b2cd
d71830d
49daeb7
39dd976
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,9 @@ public final class CrossPlatformExtension: NSObject { | |
| if Self.contextSharingTransformer == nil { | ||
| let core = CoreRegistry.default | ||
| let contextSharingTransformer = ContextSharingTransformer() | ||
| try? core.register(feature: ContextSharingFeature(messageReceiver: contextSharingTransformer)) | ||
| // Subscribe before registration so initial context push is received: | ||
| core.messageBus.subscribe(receiver: contextSharingTransformer) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because Useful? React with 👍 / 👎. |
||
| try? core.register(feature: ContextSharingFeature(messageReceiver: NOPFeatureMessageReceiver())) | ||
| Self.contextSharingTransformer = contextSharingTransformer | ||
| } | ||
| contextSharingTransformer?.publish(to: toSharedContext) | ||
|
|
||
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 forwards only future context writes to typed subscribers, but registration still replays the current context only through
add(messageReceiver:), which sends.contextto the feature's legacymessageReceiver. The two migrated subscribers are now registered withNOPFeatureMessageReceiver()inCrossPlatformExtensionandregister(urlSessionHandler:), so if shared-context or network instrumentation is registered after user/RUM/trace context already exists, their typed receivers start withnil/stale context until another context mutation occurs; early shared-context callbacks and intercepted requests will miss that context.Useful? React with 👍 / 👎.