From 364c43b53b56f937c06b5c98baa0abaaacc29fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Tue, 16 Jul 2024 08:19:42 +0200 Subject: [PATCH 1/2] Fix incorrect decoding of timeout property in network configuration (close #902) --- Sources/Snowplow/Configurations/NetworkConfiguration.swift | 4 +++- Tests/Configurations/TestRemoteConfiguration.swift | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/Snowplow/Configurations/NetworkConfiguration.swift b/Sources/Snowplow/Configurations/NetworkConfiguration.swift index 4eaf94c73..96a2b1f3f 100644 --- a/Sources/Snowplow/Configurations/NetworkConfiguration.swift +++ b/Sources/Snowplow/Configurations/NetworkConfiguration.swift @@ -183,6 +183,8 @@ public class NetworkConfiguration: SerializableConfiguration, ConfigurationProto _method = HttpMethodOptions(rawValue: coder.decodeInteger(forKey: "method")) _customPostPath = coder.decodeObject(forKey: "customPostPath") as? String _requestHeaders = coder.decodeObject(forKey: "requestHeaders") as? [String : String] - _timeout = coder.decodeObject(forKey: "timeout") as? TimeInterval + if coder.containsValue(forKey: "timeout") { + _timeout = coder.decodeDouble(forKey: "timeout") + } } } diff --git a/Tests/Configurations/TestRemoteConfiguration.swift b/Tests/Configurations/TestRemoteConfiguration.swift index 0e1ce415c..8550a9651 100644 --- a/Tests/Configurations/TestRemoteConfiguration.swift +++ b/Tests/Configurations/TestRemoteConfiguration.swift @@ -98,7 +98,9 @@ class TestRemoteConfiguration: XCTestCase { #if os(iOS) || os(macOS) func testCache() { - let bundle = ConfigurationBundle(namespace: "namespace", networkConfiguration: NetworkConfiguration(endpoint: "endpoint")) + let networkConfig = NetworkConfiguration(endpoint: "endpoint") + networkConfig.timeout = 100 + let bundle = ConfigurationBundle(namespace: "namespace", networkConfiguration: networkConfig) let expected = RemoteConfigurationBundle(schema: "http://iglucentral.com/schemas/com.snowplowanalytics.mobile/remote_config/jsonschema/1-0-0", configurationVersion: 12) expected.configurationBundle = [bundle] @@ -119,6 +121,7 @@ class TestRemoteConfiguration: XCTestCase { let expectedBundle = expected.configurationBundle[0] let configBundle = config?.configurationBundle[0] XCTAssertEqual(expectedBundle.networkConfiguration?.endpoint, configBundle?.networkConfiguration?.endpoint) + XCTAssertEqual(configBundle?.networkConfiguration?.timeout, 100) XCTAssertNil(configBundle?.trackerConfiguration) } From f54276010ce24d92e3c999b3df985fcb4f56d6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matu=CC=81s=CC=8C=20Tomlein?= Date: Tue, 16 Jul 2024 08:38:37 +0200 Subject: [PATCH 2/2] Prepare for 6.0.7 release --- CHANGELOG | 4 ++++ Examples | 2 +- SnowplowTracker.podspec | 2 +- Sources/Core/TrackerConstants.swift | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0ceabb9f2..320fb05c1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 6.0.7 (2024-07-16) +-------------------------- +Fix incorrect decoding of timeout property in network configuration (#902) + Version 6.0.6 (2024-07-10) -------------------------- Fix remote configuration attempting to serialize a logger class after new configuration is fetched (#900) diff --git a/Examples b/Examples index 2bdba1b90..26d1f93aa 160000 --- a/Examples +++ b/Examples @@ -1 +1 @@ -Subproject commit 2bdba1b90b8305de448c9c938618013cb1ed3907 +Subproject commit 26d1f93aa04ee85a1f492204f5ded0725a2de6af diff --git a/SnowplowTracker.podspec b/SnowplowTracker.podspec index 4dbc1550f..698d850a9 100644 --- a/SnowplowTracker.podspec +++ b/SnowplowTracker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SnowplowTracker" - s.version = "6.0.6" + s.version = "6.0.7" 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. diff --git a/Sources/Core/TrackerConstants.swift b/Sources/Core/TrackerConstants.swift index a2102a4ea..d60736d45 100644 --- a/Sources/Core/TrackerConstants.swift +++ b/Sources/Core/TrackerConstants.swift @@ -14,7 +14,7 @@ import Foundation // --- Version -let kSPRawVersion = "6.0.6" +let kSPRawVersion = "6.0.7" #if os(iOS) let kSPVersion = "ios-\(kSPRawVersion)" #elseif os(tvOS)