Skip to content

Commit

Permalink
RUMM-2334 Fix data race in RUM scope
Browse files Browse the repository at this point in the history
  • Loading branch information
maxep committed Aug 30, 2022
1 parent 0073de5 commit db2072a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Sources/Datadog/RUMMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -596,19 +596,15 @@ public class RUMMonitor: DDRUMMonitor, RUMCommandSubscriber {
// MARK: - RUMCommandSubscriber

func process(command: RUMCommand) {
guard let scope = core.v1.scope(for: RUMFeature.self) else {
return
}

queue.async {
let transformedCommand = self.transform(command: command)
core.v1.scope(for: RUMFeature.self)?.eventWriteContext { context, writer in
self.queue.async {
let transformedCommand = self.transform(command: command)

scope.eventWriteContext { context, writer in
_ = self.applicationScope.process(command: transformedCommand, context: context, writer: writer)
}

if let debugging = self.debugging {
debugging.debug(applicationScope: self.applicationScope)
if let debugging = self.debugging {
debugging.debug(applicationScope: self.applicationScope)
}
}
}
}
Expand Down

0 comments on commit db2072a

Please sign in to comment.