Skip to content

Commit

Permalink
fix: add attributes to properties (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-aman committed Mar 19, 2024
1 parent c5e5ed7 commit 4b02e92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions Sources/DataPipeline/DataPipelineImplementation.swift
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Migration/DataPipelineMigrationAssistant.swift
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 4b02e92

Please sign in to comment.