Skip to content

Commit

Permalink
chore: update to latest analytics fork (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 authored Apr 1, 2024
2 parents 82d713c + 38f9439 commit c3e887e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CustomerIODataPipelines.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Pod::Spec.new do |spec|
spec.dependency "CustomerIOTrackingMigration", "= #{spec.version.to_s}"

# Add Segment SDK as a dependency, as this module is designed to be compatible with it.
spec.dependency 'AnalyticsSwiftCIO', '= 1.5.5-cio.1'
spec.dependency 'AnalyticsSwiftCIO', '= 1.5.9+cio.2'
end
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let package = Package(
.package(name: "Firebase", url: "https://github.com/firebase/firebase-ios-sdk.git", "8.7.0"..<"11.0.0"),

// The version is a git commit hash. Make sure the commit is the same as what the DataPipelines CocoaPods is using.
.package(name: "Segment", url: "https://github.com/customerio/cdp-analytics-swift.git", .exact("1.5.5-cio.1"))
.package(name: "Segment", url: "https://github.com/customerio/cdp-analytics-swift.git", .exact("1.5.9+cio.1"))
],
targets: [
// Common - Code used by multiple modules in the SDK project.
Expand Down
13 changes: 9 additions & 4 deletions Tests/DataPipeline/DataPipelineCompatibilityTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -477,16 +477,21 @@ private extension DataPipelineCompatibilityTests {
}

func readTypeFromStorage(cdpApiKey: String? = nil, key: Storage.Constants) -> [SavedEvent] {
guard let results = storage.read(key) else { return [] }
guard let results = storage.read(key),
let files = results.dataFiles else { return [] }

return results.flatMap { result -> [SavedEvent] in
return files.flatMap { result -> [SavedEvent] in
guard let content = readFileFromURL(result),
let dict = convertJSONStringToSavedEvent(content),
let batch = dict["batch"] as? [SavedEvent],
cdpApiKey == nil || cdpApiKey == dict["writeKey"] as? String
let batch = dict["batch"] as? [SavedEvent]
else {
return []
}

if let apiKey = cdpApiKey, apiKey != dict["writeKey"] as? String {
return []
}

return batch
}
}
Expand Down

0 comments on commit c3e887e

Please sign in to comment.