diff --git a/Sources/DataPipeline/DataPipelineImplementation.swift b/Sources/DataPipeline/DataPipelineImplementation.swift index b0ad4486b..a42214164 100644 --- a/Sources/DataPipeline/DataPipelineImplementation.swift +++ b/Sources/DataPipeline/DataPipelineImplementation.swift @@ -339,14 +339,13 @@ extension DataPipelineImplementation { let journeyDict: [String: Any] = ["journeys": ["identifiers": ["id": identifier]]] var tokenDict: [String: Any] = ["token": token, "type": "ios"] - if let attributes = attributes { - tokenDict = tokenDict.mergeWith(attributes) - } - let deviceDict: [String: Any] = ["device": tokenDict] if let context = try? JSON(deviceDict.mergeWith(journeyDict)) { trackRegisterTokenEvent.context = context } + if let attributes = attributes, let attributes = try? JSON(attributes) { + trackRegisterTokenEvent.properties = attributes + } analytics.process(event: trackRegisterTokenEvent) } diff --git a/Sources/Migration/DataPipelineMigrationAssistant.swift b/Sources/Migration/DataPipelineMigrationAssistant.swift index d95a1ec92..4ef04e7a1 100644 --- a/Sources/Migration/DataPipelineMigrationAssistant.swift +++ b/Sources/Migration/DataPipelineMigrationAssistant.swift @@ -55,9 +55,9 @@ public class DataPipelineMigrationAssistant { logger.info("CIO-CDP Migration: No tasks pending in the background queue to be executed.") return } - threadUtil.runBackground { [weak self] in + threadUtil.runBackground { allStoredTasks.forEach { task in - self?.getAndProcessTask(for: task, siteId: siteId) + self.getAndProcessTask(for: task, siteId: siteId) } } }