Skip to content

Commit 12483fe

Browse files
committed
[RUM-16486] Fix DatadogContext not propagated to legacy FeatureMessageReceiver
1 parent 5f7ea71 commit 12483fe

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

DatadogCore/Sources/Core/DatadogCore.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ internal final class DatadogCore {
119119
// the bus will keep a weak ref to the core.
120120
bus.connect(core: self)
121121

122-
// forward any context change on the typed message-bus
122+
// forward any context change on the message-bus
123123
self.contextProvider.publish { [weak self] context in
124-
self?.bus.send(message: context)
124+
self?.bus.send(message: context) // typed bus (new receivers)
125+
self?.send(message: .context(context)) // legacy bus (receivers pending migration)
125126
}
126127
}
127128

@@ -264,9 +265,8 @@ internal final class DatadogCore {
264265
/// - key: The key associated with the receiver.
265266
private func add(messageReceiver: FeatureMessageReceiver, forKey key: String) {
266267
bus.connect(messageReceiver, forKey: key)
267-
// Push current context to typed-bus DatadogContext subscribers.
268268
contextProvider.read { context in
269-
self.bus.send(message: context)
269+
self.bus.queue.async { messageReceiver.receive(message: .context(context), from: self) }
270270
}
271271
}
272272

0 commit comments

Comments
 (0)