From a627d49b98e9e8a6984964fe194007a5db8fd279 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 28 Jan 2025 13:44:56 -0300 Subject: [PATCH 1/6] Update config & method parser in Android implementation --- splitio_android/android/build.gradle | 2 +- .../splitio/SplitClientConfigHelper.java | 20 +++++++++++++++++++ .../split/splitio/SplitMethodParserImpl.java | 1 + .../splitio/SplitClientConfigHelperTest.java | 16 +++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/splitio_android/android/build.gradle b/splitio_android/android/build.gradle index f943883..e808137 100644 --- a/splitio_android/android/build.gradle +++ b/splitio_android/android/build.gradle @@ -36,7 +36,7 @@ android { } dependencies { - implementation 'io.split.client:android-client:5.0.0' + implementation 'io.split.client:android-client:5.1.0-rc1' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/splitio_android/android/src/main/java/io/split/splitio/SplitClientConfigHelper.java b/splitio_android/android/src/main/java/io/split/splitio/SplitClientConfigHelper.java index ce83e03..2df8e0d 100644 --- a/splitio_android/android/src/main/java/io/split/splitio/SplitClientConfigHelper.java +++ b/splitio_android/android/src/main/java/io/split/splitio/SplitClientConfigHelper.java @@ -10,6 +10,7 @@ import java.util.Set; import java.util.concurrent.TimeUnit; +import io.split.android.client.RolloutCacheConfiguration; import io.split.android.client.ServiceEndpoints; import io.split.android.client.SplitClientConfig; import io.split.android.client.SplitFilter; @@ -51,6 +52,9 @@ class SplitClientConfigHelper { private static final String READY_TIMEOUT = "readyTimeout"; private static final String CERTIFICATE_PINNING_CONFIGURATION = "certificatePinningConfiguration"; private static final String CERTIFICATE_PINNING_CONFIGURATION_PINS = "pins"; + private static final String ROLLOUT_CACHE_CONFIGURATION = "rolloutCacheConfiguration"; + private static final String ROLLOUT_CACHE_CONFIGURATION_EXPIRATION = "expirationDays"; + private static final String ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT = "clearOnInit"; /** * Creates a {@link SplitClientConfig} object from a map. @@ -242,6 +246,22 @@ static SplitClientConfig fromMap(@NonNull Map configurationMap, } } + Map rolloutCacheConfiguration = getObjectMap(configurationMap, ROLLOUT_CACHE_CONFIGURATION); + if (rolloutCacheConfiguration != null) { + Integer expirationDays = getInteger(rolloutCacheConfiguration, ROLLOUT_CACHE_CONFIGURATION_EXPIRATION); + Boolean clearOnInit = getBoolean(rolloutCacheConfiguration, ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT); + if (expirationDays != null || clearOnInit != null) { + RolloutCacheConfiguration.Builder cacheConfigBuilder = RolloutCacheConfiguration.builder(); + if (expirationDays != null) { + cacheConfigBuilder.expirationDays(expirationDays); + } + if (clearOnInit != null) { + cacheConfigBuilder.clearOnInit(clearOnInit); + } + builder.rolloutCacheConfiguration(cacheConfigBuilder.build()); + } + } + return builder.serviceEndpoints(serviceEndpointsBuilder.build()).build(); } diff --git a/splitio_android/android/src/main/java/io/split/splitio/SplitMethodParserImpl.java b/splitio_android/android/src/main/java/io/split/splitio/SplitMethodParserImpl.java index 812143c..7631b13 100644 --- a/splitio_android/android/src/main/java/io/split/splitio/SplitMethodParserImpl.java +++ b/splitio_android/android/src/main/java/io/split/splitio/SplitMethodParserImpl.java @@ -474,6 +474,7 @@ private static Map getSplitViewAsMap(@Nullable SplitView splitVi splitViewMap.put("configs", splitView.configs); splitViewMap.put("defaultTreatment", splitView.defaultTreatment); splitViewMap.put("sets", splitView.sets); + splitViewMap.put("impressionsDisabled", splitView.impressionsDisabled); return splitViewMap; } diff --git a/splitio_android/android/src/test/java/io/split/splitio/SplitClientConfigHelperTest.java b/splitio_android/android/src/test/java/io/split/splitio/SplitClientConfigHelperTest.java index 18691f0..23a5215 100644 --- a/splitio_android/android/src/test/java/io/split/splitio/SplitClientConfigHelperTest.java +++ b/splitio_android/android/src/test/java/io/split/splitio/SplitClientConfigHelperTest.java @@ -219,4 +219,20 @@ public void certificatePinningConfigurationValuesAreMappedCorrectly() { Set host2Pins = actualConfig.getPins().get("host2"); assertEquals("sha256", host2Pins.iterator().next().getAlgorithm()); } + + @Test + public void rolloutCacheConfigurationValuesAreMappedCorrectly() { + Map configValues = new HashMap<>(); + Map rolloutCacheConfigValues = new HashMap<>(); + + rolloutCacheConfigValues.put("expirationDays", 5); + rolloutCacheConfigValues.put("clearOnInit", true); + configValues.put("rolloutCacheConfiguration", rolloutCacheConfigValues); + + SplitClientConfig splitClientConfig = SplitClientConfigHelper + .fromMap(configValues, mock(ImpressionListener.class)); + + assertEquals(5, splitClientConfig.rolloutCacheConfiguration().getExpirationDays()); + assertTrue(splitClientConfig.rolloutCacheConfiguration().isClearOnInit()); + } } From f7a7260039bc03cdb16fb7c2add0d098daffe50f Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 28 Jan 2025 13:50:06 -0300 Subject: [PATCH 2/6] Temporal relative dependency --- splitio/example/pubspec.lock | 7 +++---- splitio/pubspec.yaml | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/splitio/example/pubspec.lock b/splitio/example/pubspec.lock index 8da00b5..00b0f01 100644 --- a/splitio/example/pubspec.lock +++ b/splitio/example/pubspec.lock @@ -170,10 +170,9 @@ packages: splitio_android: dependency: transitive description: - name: splitio_android - sha256: "44b0e1dddd374fc73fc1b5ef89598b96ea405d533a8211c06a45665f5d6187b5" - url: "https://pub.dev" - source: hosted + path: "../../splitio_android" + relative: true + source: path version: "0.2.0" splitio_ios: dependency: transitive diff --git a/splitio/pubspec.yaml b/splitio/pubspec.yaml index 3e6d086..f15dc10 100644 --- a/splitio/pubspec.yaml +++ b/splitio/pubspec.yaml @@ -1,3 +1,4 @@ +publish_to: none # TODO name: splitio description: Official plugin for split.io, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience. version: 0.2.0 @@ -19,7 +20,8 @@ flutter: dependencies: flutter: sdk: flutter - splitio_android: ^0.2.0 + splitio_android: + path: ../splitio_android splitio_ios: ^0.2.0 splitio_platform_interface: ^1.5.0 From d12cce60e1ac3eac97a19cd8e2c96b995760851c Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 28 Jan 2025 16:24:40 -0300 Subject: [PATCH 3/6] WIP --- splitio/example/pubspec.lock | 14 ++++----- splitio/pubspec.yaml | 8 +++-- splitio_android/pubspec.yaml | 3 +- .../ios/SplitTests/ExtensionsTests.swift | 26 +++++++++++++++++ .../SplitClientConfigHelperTests.swift | 12 ++++++++ splitio_ios/example/pubspec.lock | 4 +-- splitio_ios/ios/Classes/Extensions.swift | 3 +- .../ios/Classes/SplitClientConfigHelper.swift | 29 +++++++++++++++---- splitio_ios/pubspec.yaml | 3 +- 9 files changed, 81 insertions(+), 21 deletions(-) diff --git a/splitio/example/pubspec.lock b/splitio/example/pubspec.lock index 00b0f01..a3269a9 100644 --- a/splitio/example/pubspec.lock +++ b/splitio/example/pubspec.lock @@ -177,18 +177,16 @@ packages: splitio_ios: dependency: transitive description: - name: splitio_ios - sha256: "7c7a2a60711b8e6267cde7e2754d30931dafc76b20b28e1356624963628cb166" - url: "https://pub.dev" - source: hosted + path: "../../splitio_ios" + relative: true + source: path version: "0.2.0" splitio_platform_interface: dependency: transitive description: - name: splitio_platform_interface - sha256: "2f0457991d18d654486264a66dacf54c7cf23cd88bbb73ed299d69dbbc2fd49b" - url: "https://pub.dev" - source: hosted + path: "../../splitio_platform_interface" + relative: true + source: path version: "1.5.0" stack_trace: dependency: transitive diff --git a/splitio/pubspec.yaml b/splitio/pubspec.yaml index f15dc10..0e5d8d1 100644 --- a/splitio/pubspec.yaml +++ b/splitio/pubspec.yaml @@ -20,10 +20,12 @@ flutter: dependencies: flutter: sdk: flutter - splitio_android: + splitio_android: # ^0.2.0 path: ../splitio_android - splitio_ios: ^0.2.0 - splitio_platform_interface: ^1.5.0 + splitio_ios: # ^0.2.0 + path: ../splitio_ios + splitio_platform_interface: # ^1.5.0 + path: ../splitio_platform_interface dev_dependencies: flutter_test: diff --git a/splitio_android/pubspec.yaml b/splitio_android/pubspec.yaml index cc75d6e..79bcfb8 100644 --- a/splitio_android/pubspec.yaml +++ b/splitio_android/pubspec.yaml @@ -19,7 +19,8 @@ flutter: dependencies: flutter: sdk: flutter - splitio_platform_interface: ^1.5.0 + splitio_platform_interface: # ^1.5.0 + path: ../splitio_platform_interface dev_dependencies: flutter_test: diff --git a/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift b/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift index 8cc0e67..28b7780 100644 --- a/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift +++ b/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift @@ -26,4 +26,30 @@ class ExtensionsTests: XCTestCase { "split": "my-split", "time": 16161616])) } + + func testSplitViewMapping() throws { + var splitView = SplitView() + splitView.name = "my-split" + splitView.trafficType = "account" + splitView.killed = true + splitView.treatments = ["on", "off"] + splitView.changeNumber = 121212 + splitView.configs = ["key": "value"] + splitView.defaultTreatment = "off" + splitView.sets = ["set1", "set2"] + splitView.impressionsDisabled = true + + let splitViewMap = SplitView.asMap(splitView: splitView) + XCTAssert(splitViewMap.count == 9) + XCTAssert(NSDictionary(dictionary: splitViewMap).isEqual(to: [ + "name": "my-split", + "trafficType": "account", + "killed": true, + "treatments": ["on", "off"], + "changeNumber": 121212, + "configs": ["key": "value"], + "defaultTreatment": "off", + "sets": ["set1", "set2"], + "impressionsDisabled": true])) + } } diff --git a/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift b/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift index d07edd7..cfacdea 100644 --- a/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift +++ b/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift @@ -135,4 +135,16 @@ class SplitClientConfigHelperTests: XCTestCase { (pin.host == "host2" && pin.algo == KeyHashAlgo.sha256 ) } } + + func testRolloutCacheConfigurationValuesAreMappedCorrectly() { + let configValues = [ + "rolloutCacheConfiguration": [ + "expirationDays": 5, + "clearOnInit": true + ] + ] + + let splitClientConfig: SplitClientConfig = SplitClientConfigHelper.fromMap(configurationMap: configValues, impressionListener: nil) + let actualConfig = splitClientConfig.rolloutCacheConfiguration + } } diff --git a/splitio_ios/example/pubspec.lock b/splitio_ios/example/pubspec.lock index 23342f6..ec19606 100644 --- a/splitio_ios/example/pubspec.lock +++ b/splitio_ios/example/pubspec.lock @@ -166,14 +166,14 @@ packages: path: ".." relative: true source: path - version: "0.1.9" + version: "0.2.0" splitio_platform_interface: dependency: transitive description: path: "../../splitio_platform_interface" relative: true source: path - version: "1.4.0" + version: "1.5.0" stack_trace: dependency: transitive description: diff --git a/splitio_ios/ios/Classes/Extensions.swift b/splitio_ios/ios/Classes/Extensions.swift index d17250c..b752e73 100644 --- a/splitio_ios/ios/Classes/Extensions.swift +++ b/splitio_ios/ios/Classes/Extensions.swift @@ -24,7 +24,8 @@ extension SplitView { "changeNumber": splitView.changeNumber, "configs": splitView.configs, "defaultTreatment": splitView.defaultTreatment, - "sets": splitView.sets + "sets": splitView.sets, + "impressionsDisabled": splitView.impressionsDisabled, ] } else { return [:] diff --git a/splitio_ios/ios/Classes/SplitClientConfigHelper.swift b/splitio_ios/ios/Classes/SplitClientConfigHelper.swift index 025237b..28b4c09 100644 --- a/splitio_ios/ios/Classes/SplitClientConfigHelper.swift +++ b/splitio_ios/ios/Classes/SplitClientConfigHelper.swift @@ -33,6 +33,9 @@ class SplitClientConfigHelper { static private let READY_TIMEOUT = "readyTimeout" static private let CERTIFICATE_PINNING_CONFIGURATION = "certificatePinningConfiguration" static private let CERTIFICATE_PINNING_CONFIGURATION_PINS = "pins"; + static private let ROLLOUT_CACHE_CONFIGURATION = "rolloutCacheConfiguration" + static private let ROLLOUT_CACHE_CONFIGURATION_EXPIRATION = "expirationDays" + static private let ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT = "clearOnInit" static func fromMap(configurationMap: [String: Any?], impressionListener: SplitImpressionListener?) -> SplitClientConfig { let config = SplitClientConfig() @@ -117,31 +120,31 @@ class SplitClientConfigHelper { if configurationMap[SDK_ENDPOINT] != nil { if let sdkEndpoint = configurationMap[SDK_ENDPOINT] as? String { - serviceEndpointsBuilder.set(sdkEndpoint: sdkEndpoint) + _ = serviceEndpointsBuilder.set(sdkEndpoint: sdkEndpoint) } } if configurationMap[EVENTS_ENDPOINT] != nil { if let eventsEndpoint = configurationMap[EVENTS_ENDPOINT] as? String { - serviceEndpointsBuilder.set(eventsEndpoint: eventsEndpoint) + _ = serviceEndpointsBuilder.set(eventsEndpoint: eventsEndpoint) } } if configurationMap[SSE_AUTH_SERVICE_ENDPOINT] != nil { if let sseAuthServiceEndpoint = configurationMap[SSE_AUTH_SERVICE_ENDPOINT] as? String { - serviceEndpointsBuilder.set(authServiceEndpoint: sseAuthServiceEndpoint) + _ = serviceEndpointsBuilder.set(authServiceEndpoint: sseAuthServiceEndpoint) } } if configurationMap[STREAMING_SERVICE_ENDPOINT] != nil { if let streamingServiceEndpoint = configurationMap[STREAMING_SERVICE_ENDPOINT] as? String { - serviceEndpointsBuilder.set(streamingServiceEndpoint: streamingServiceEndpoint) + _ = serviceEndpointsBuilder.set(streamingServiceEndpoint: streamingServiceEndpoint) } } if configurationMap[TELEMETRY_SERVICE_ENDPOINT] != nil { if let telemetryServiceEndpoint = configurationMap[TELEMETRY_SERVICE_ENDPOINT] as? String { - serviceEndpointsBuilder.set(telemetryServiceEndpoint: telemetryServiceEndpoint) + _ = serviceEndpointsBuilder.set(telemetryServiceEndpoint: telemetryServiceEndpoint) } } @@ -234,6 +237,22 @@ class SplitClientConfigHelper { } } + if let rolloutCacheConfig = configurationMap[ROLLOUT_CACHE_CONFIGURATION] as? [String: Any?] { + let rolloutCacheConfigurationBuilder = RolloutCacheConfiguration.builder() + if configurationMap[ROLLOUT_CACHE_CONFIGURATION][ROLLOUT_CACHE_CONFIGURATION_EXPIRATION] != nil { + if let expirationDays = rolloutCacheConfig[ROLLOUT_CACHE_CONFIGURATION_EXPIRATION] as? Int { + rolloutCacheConfigurationBuilder.set(expirationPeriod: expirationDays) + } + } + + if configurationMap[ROLLOUT_CACHE_CONFIGURATION][ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT] != nil { + if let clearOnInit = rolloutCacheConfig[ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT] as? Bool { + rolloutCacheConfigurationBuilder.set(clearOnInitialization: clearOnInit) + } + } + config.rolloutCacheConfiguration = rolloutCacheConfigurationBuilder.build() + } + return config } diff --git a/splitio_ios/pubspec.yaml b/splitio_ios/pubspec.yaml index 5e77494..06849c8 100644 --- a/splitio_ios/pubspec.yaml +++ b/splitio_ios/pubspec.yaml @@ -18,7 +18,8 @@ flutter: dependencies: flutter: sdk: flutter - splitio_platform_interface: ^1.5.0 + splitio_platform_interface: # ^1.5.0 + path: ../splitio_platform_interface dev_dependencies: flutter_test: From f9079ff6881e0d0d56b2ab57f83276660e7b42ce Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 28 Jan 2025 17:29:59 -0300 Subject: [PATCH 4/6] Point to branch for development --- splitio_ios/example/ios/Podfile | 4 ++++ splitio_ios/example/ios/Podfile.lock | 23 +++++++++++-------- .../ios/SplitTests/ExtensionsTests.swift | 1 + splitio_ios/ios/Classes/Extensions.swift | 2 +- .../ios/Classes/SplitClientConfigHelper.swift | 8 +++---- splitio_ios/ios/splitio_ios.podspec | 2 +- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/splitio_ios/example/ios/Podfile b/splitio_ios/example/ios/Podfile index 8629561..c4289ff 100644 --- a/splitio_ios/example/ios/Podfile +++ b/splitio_ios/example/ios/Podfile @@ -32,6 +32,8 @@ target 'Runner' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + + pod 'Split', :git => 'https://github.com/splitio/ios-client.git', :branch => 'SDKS-9073_baseline' # TODO: remove; development only end target 'SplitTests' do @@ -39,6 +41,8 @@ target 'SplitTests' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + + pod 'Split', :git => 'https://github.com/splitio/ios-client.git', :branch => 'SDKS-9073_baseline' # TODO: remove; development only end post_install do |installer| diff --git a/splitio_ios/example/ios/Podfile.lock b/splitio_ios/example/ios/Podfile.lock index f1c80a0..74afb24 100644 --- a/splitio_ios/example/ios/Podfile.lock +++ b/splitio_ios/example/ios/Podfile.lock @@ -1,29 +1,34 @@ PODS: - Flutter (1.0.0) - - Split (3.0.0) + - Split (3.1.0) - splitio_ios (0.7.0): - Flutter - - Split (~> 3.0.0) + - Split DEPENDENCIES: - Flutter (from `Flutter`) + - Split (from `https://github.com/splitio/ios-client.git`, branch `SDKS-9073_baseline`) - splitio_ios (from `.symlinks/plugins/splitio_ios/ios`) -SPEC REPOS: - trunk: - - Split - EXTERNAL SOURCES: Flutter: :path: Flutter + Split: + :branch: SDKS-9073_baseline + :git: https://github.com/splitio/ios-client.git splitio_ios: :path: ".symlinks/plugins/splitio_ios/ios" +CHECKOUT OPTIONS: + Split: + :commit: a7af0ff343daadee1df395b8e1038514026666c6 + :git: https://github.com/splitio/ios-client.git + SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - Split: 66424040ad573d052f58269f841e71b34578a916 - splitio_ios: e4e3becbe89cae0a2fa9ca03a575c21f23af0d90 + Split: 17f15abcc74b39c3a8d670f59e787163626ad6b5 + splitio_ios: 00bf48283a9e3f9497a973d9b5cafc5d414dd427 -PODFILE CHECKSUM: aed42fc5c94ade572556b7ed357c5c57f1bd83a2 +PODFILE CHECKSUM: 79606d939bc65bb57cdc13d8613e7015102c2e64 COCOAPODS: 1.15.0 diff --git a/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift b/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift index 28b7780..cdb123e 100644 --- a/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift +++ b/splitio_ios/example/ios/SplitTests/ExtensionsTests.swift @@ -1,5 +1,6 @@ import XCTest import Split +@testable import splitio_ios class ExtensionsTests: XCTestCase { diff --git a/splitio_ios/ios/Classes/Extensions.swift b/splitio_ios/ios/Classes/Extensions.swift index b752e73..fdad567 100644 --- a/splitio_ios/ios/Classes/Extensions.swift +++ b/splitio_ios/ios/Classes/Extensions.swift @@ -1,7 +1,7 @@ import Split extension Impression { - public func toMap() -> [String: Any?] { + func toMap() -> [String: Any?] { ["key": keyName, "bucketingKey": bucketingKey, "split": feature, diff --git a/splitio_ios/ios/Classes/SplitClientConfigHelper.swift b/splitio_ios/ios/Classes/SplitClientConfigHelper.swift index 28b4c09..abe76d0 100644 --- a/splitio_ios/ios/Classes/SplitClientConfigHelper.swift +++ b/splitio_ios/ios/Classes/SplitClientConfigHelper.swift @@ -239,15 +239,15 @@ class SplitClientConfigHelper { if let rolloutCacheConfig = configurationMap[ROLLOUT_CACHE_CONFIGURATION] as? [String: Any?] { let rolloutCacheConfigurationBuilder = RolloutCacheConfiguration.builder() - if configurationMap[ROLLOUT_CACHE_CONFIGURATION][ROLLOUT_CACHE_CONFIGURATION_EXPIRATION] != nil { + if rolloutCacheConfig[ROLLOUT_CACHE_CONFIGURATION_EXPIRATION] != nil { if let expirationDays = rolloutCacheConfig[ROLLOUT_CACHE_CONFIGURATION_EXPIRATION] as? Int { - rolloutCacheConfigurationBuilder.set(expirationPeriod: expirationDays) + rolloutCacheConfigurationBuilder.set(expirationDays: expirationDays) } } - if configurationMap[ROLLOUT_CACHE_CONFIGURATION][ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT] != nil { + if rolloutCacheConfig[ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT] != nil { if let clearOnInit = rolloutCacheConfig[ROLLOUT_CACHE_CONFIGURATION_CLEAR_ON_INIT] as? Bool { - rolloutCacheConfigurationBuilder.set(clearOnInitialization: clearOnInit) + rolloutCacheConfigurationBuilder.set(clearOnInit: clearOnInit) } } config.rolloutCacheConfiguration = rolloutCacheConfigurationBuilder.build() diff --git a/splitio_ios/ios/splitio_ios.podspec b/splitio_ios/ios/splitio_ios.podspec index a593c06..78c16a3 100644 --- a/splitio_ios/ios/splitio_ios.podspec +++ b/splitio_ios/ios/splitio_ios.podspec @@ -15,7 +15,7 @@ split.io official Flutter plugin. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'Flutter' - s.dependency 'Split', '~> 3.0.0' + s.dependency 'Split' # TODO: specify version s.platform = :ios, '9.0' # Flutter.framework does not contain a i386 slice. From 019c2cf719494c6987c9ebbabe380f976271fede Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 28 Jan 2025 18:03:00 -0300 Subject: [PATCH 5/6] Fix --- splitio_ios/example/ios/Podfile.lock | 4 ++-- .../SplitClientConfigHelperTests.swift | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/splitio_ios/example/ios/Podfile.lock b/splitio_ios/example/ios/Podfile.lock index 74afb24..5ee5b26 100644 --- a/splitio_ios/example/ios/Podfile.lock +++ b/splitio_ios/example/ios/Podfile.lock @@ -21,7 +21,7 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: Split: - :commit: a7af0ff343daadee1df395b8e1038514026666c6 + :commit: 708427ff99d24e2f2ae6e5a672ee23efebafba06 :git: https://github.com/splitio/ios-client.git SPEC CHECKSUMS: @@ -29,6 +29,6 @@ SPEC CHECKSUMS: Split: 17f15abcc74b39c3a8d670f59e787163626ad6b5 splitio_ios: 00bf48283a9e3f9497a973d9b5cafc5d414dd427 -PODFILE CHECKSUM: 79606d939bc65bb57cdc13d8613e7015102c2e64 +PODFILE CHECKSUM: 3e7633332e3580ada5ac333ff9c0b05e8c0b7972 COCOAPODS: 1.15.0 diff --git a/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift b/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift index cfacdea..2c29a06 100644 --- a/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift +++ b/splitio_ios/example/ios/SplitTests/SplitClientConfigHelperTests.swift @@ -127,13 +127,17 @@ class SplitClientConfigHelperTests: XCTestCase { ] let splitClientConfig: SplitClientConfig = SplitClientConfigHelper.fromMap(configurationMap: configValues, impressionListener: nil) - let actualConfig = splitClientConfig.certificatePinningConfig?.pins + let actualConfig = splitClientConfig.certificatePinningConfig!.pins - let containsPins = actualConfig?.contains { pin in - (pin.host == "host1" && pin.algo == KeyHashAlgo.sha256) && - (pin.host == "host1" && pin.algo == KeyHashAlgo.sha1) && + let containsPins = actualConfig.contains { pin in + (pin.host == "host1" && pin.algo == KeyHashAlgo.sha256) } && + actualConfig.contains { pin in + (pin.host == "host1" && pin.algo == KeyHashAlgo.sha1) } && + actualConfig.contains { pin in (pin.host == "host2" && pin.algo == KeyHashAlgo.sha256 ) } + + XCTAssertTrue(containsPins) } func testRolloutCacheConfigurationValuesAreMappedCorrectly() { @@ -145,6 +149,9 @@ class SplitClientConfigHelperTests: XCTestCase { ] let splitClientConfig: SplitClientConfig = SplitClientConfigHelper.fromMap(configurationMap: configValues, impressionListener: nil) - let actualConfig = splitClientConfig.rolloutCacheConfiguration + let actualConfig = splitClientConfig.rolloutCacheConfiguration! + + XCTAssertEqual(5, actualConfig.expirationDays) + XCTAssertTrue(actualConfig.clearOnInit) } } From fff409217eba1cac879f5f48369de067727a2996 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Tue, 28 Jan 2025 18:48:57 -0300 Subject: [PATCH 6/6] Fix dep --- splitio/example/ios/Podfile | 2 ++ splitio/example/ios/Podfile.lock | 23 ++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/splitio/example/ios/Podfile b/splitio/example/ios/Podfile index 2c068c4..0b6609e 100644 --- a/splitio/example/ios/Podfile +++ b/splitio/example/ios/Podfile @@ -32,6 +32,8 @@ target 'Runner' do use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + + pod 'Split', :git => 'https://github.com/splitio/ios-client.git', :branch => 'SDKS-9073_baseline' # TODO: remove; development only end post_install do |installer| diff --git a/splitio/example/ios/Podfile.lock b/splitio/example/ios/Podfile.lock index ddaefcf..56de32d 100644 --- a/splitio/example/ios/Podfile.lock +++ b/splitio/example/ios/Podfile.lock @@ -1,29 +1,34 @@ PODS: - Flutter (1.0.0) - - Split (3.0.0) + - Split (3.1.0) - splitio_ios (0.7.0): - Flutter - - Split (~> 3.0.0) + - Split DEPENDENCIES: - Flutter (from `Flutter`) + - Split (from `https://github.com/splitio/ios-client.git`, branch `SDKS-9073_baseline`) - splitio_ios (from `.symlinks/plugins/splitio_ios/ios`) -SPEC REPOS: - trunk: - - Split - EXTERNAL SOURCES: Flutter: :path: Flutter + Split: + :branch: SDKS-9073_baseline + :git: https://github.com/splitio/ios-client.git splitio_ios: :path: ".symlinks/plugins/splitio_ios/ios" +CHECKOUT OPTIONS: + Split: + :commit: 708427ff99d24e2f2ae6e5a672ee23efebafba06 + :git: https://github.com/splitio/ios-client.git + SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - Split: 66424040ad573d052f58269f841e71b34578a916 - splitio_ios: e4e3becbe89cae0a2fa9ca03a575c21f23af0d90 + Split: 17f15abcc74b39c3a8d670f59e787163626ad6b5 + splitio_ios: 00bf48283a9e3f9497a973d9b5cafc5d414dd427 -PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 +PODFILE CHECKSUM: a52d9df387b5aca8aed91ec989839c51add619b2 COCOAPODS: 1.15.0