Skip to content

Commit

Permalink
Merge pull request #901 from snowplow/release/6.0.6
Browse files Browse the repository at this point in the history
Release/6.0.6
  • Loading branch information
matus-tomlein authored Jul 10, 2024
2 parents 18f62a1 + e5a1314 commit b01a810
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 6.0.6 (2024-07-10)
--------------------------
Fix remote configuration attempting to serialize a logger class after new configuration is fetched (#900)

Version 6.0.5 (2024-07-03)
--------------------------
Stop sending if events fail to be removed from the event store
Expand Down
2 changes: 1 addition & 1 deletion Examples
2 changes: 1 addition & 1 deletion SnowplowTracker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SnowplowTracker"
s.version = "6.0.5"
s.version = "6.0.6"
s.summary = "Snowplow event tracker for iOS, macOS, tvOS, watchOS for apps and games."
s.description = <<-DESC
Snowplow is a mobile and event analytics platform with a difference: rather than tell our users how they should analyze their data, we deliver their event-level data in their own data warehouse, on their own Amazon Redshift or Postgres database, so they can analyze it any way they choose. Snowplow mobile is used by data-savvy games companies and app developers to better understand their users and how they engage with their games and applications. Snowplow is open source using the business-friendly Apache License, Version 2.0 and scales horizontally to many billions of events.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Core/TrackerConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import Foundation

// --- Version
let kSPRawVersion = "6.0.5"
let kSPRawVersion = "6.0.6"
#if os(iOS)
let kSPVersion = "ios-\(kSPRawVersion)"
#elseif os(tvOS)
Expand Down
4 changes: 0 additions & 4 deletions Sources/Snowplow/Configurations/TrackerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ public class TrackerConfiguration: SerializableConfiguration, TrackerConfigurati
coder.encode(devicePlatform.rawValue, forKey: "devicePlatform")
coder.encode(base64Encoding, forKey: "base64Encoding")
coder.encode(logLevel.rawValue, forKey: "logLevel")
coder.encode(loggerDelegate, forKey: "loggerDelegate")
coder.encode(sessionContext, forKey: "sessionContext")
coder.encode(applicationContext, forKey: "applicationContext")
coder.encode(platformContext, forKey: "platformContext")
Expand Down Expand Up @@ -618,9 +617,6 @@ public class TrackerConfiguration: SerializableConfiguration, TrackerConfigurati
if let logLevel = LogLevel(rawValue: coder.decodeInteger(forKey: "logLevel")) {
self.logLevel = logLevel
}
if let loggerDelegate = coder.decodeObject(forKey: "loggerDelegate") as? LoggerDelegate {
self.loggerDelegate = loggerDelegate
}
sessionContext = coder.decodeBool(forKey: "sessionContext")
applicationContext = coder.decodeBool(forKey: "applicationContext")
platformContext = coder.decodeBool(forKey: "platformContext")
Expand Down
26 changes: 26 additions & 0 deletions Tests/Configurations/TestRemoteConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,30 @@ class TestRemoteConfiguration: XCTestCase {
XCTAssertNil(configBundle?.trackerConfiguration)
}

func testCacheTrackerConfigurationWithoutLoggerDelegate() {
let bundle = ConfigurationBundle(namespace: "namespace",
networkConfiguration: NetworkConfiguration(endpoint: "endpoint"))
bundle.trackerConfiguration = TrackerConfiguration()
.appId("my-test-app")
.loggerDelegate(MockLoggerDelegate())

let remoteBundle = RemoteConfigurationBundle(schema: "", configurationVersion: 1)
remoteBundle.configurationBundle = [bundle]
let remoteConfig = RemoteConfiguration(endpoint: generateRemoteConfigEndpoint(), method: .get)
var cache = RemoteConfigurationCache(remoteConfiguration: remoteConfig)
cache.clear()
cache.write(remoteBundle)

Thread.sleep(forTimeInterval: 1) // wait the config is written on cache.

cache = RemoteConfigurationCache(remoteConfiguration: remoteConfig)
let config = cache.read()

let configBundle = config?.configurationBundle[0]
XCTAssertTrue(configBundle?.trackerConfiguration?.appId == "my-test-app")
XCTAssertNil(configBundle?.trackerConfiguration?.loggerDelegate)
}

func testCacheEmitterConfiguration() {
let bundle = ConfigurationBundle(namespace: "namespace",
networkConfiguration: NetworkConfiguration(endpoint: "endpoint"))
Expand Down Expand Up @@ -401,6 +425,7 @@ class TestRemoteConfiguration: XCTestCase {
let bundle1 = ConfigurationBundle(namespace: "ns1")
bundle1.trackerConfiguration = TrackerConfiguration()
.appId("app-1")
.loggerDelegate(MockLoggerDelegate())
bundle1.subjectConfiguration = SubjectConfiguration()
.domainUserId("duid1")
.userId("u1")
Expand All @@ -421,6 +446,7 @@ class TestRemoteConfiguration: XCTestCase {
XCTAssertEqual("app-1", finalBundle?.trackerConfiguration?.appId)
XCTAssertEqual("u1", finalBundle?.subjectConfiguration?.userId)
XCTAssertEqual("duid2", finalBundle?.subjectConfiguration?.domainUserId)
XCTAssertNotNil(finalBundle?.trackerConfiguration?.loggerDelegate)
}

private func generateRemoteConfigEndpoint() -> String {
Expand Down

0 comments on commit b01a810

Please sign in to comment.