Skip to content

Commit b9ad43e

Browse files
authored
readyTimeout config parameter (#85)
1 parent a99bb54 commit b9ad43e

File tree

15 files changed

+128
-80
lines changed

15 files changed

+128
-80
lines changed

splitio/example/pubspec.lock

Lines changed: 73 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,58 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
url: "https://pub.dartlang.org"
8+
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9+
url: "https://pub.dev"
910
source: hosted
10-
version: "2.8.2"
11+
version: "2.11.0"
1112
boolean_selector:
1213
dependency: transitive
1314
description:
1415
name: boolean_selector
15-
url: "https://pub.dartlang.org"
16+
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17+
url: "https://pub.dev"
1618
source: hosted
17-
version: "2.1.0"
19+
version: "2.1.1"
1820
characters:
1921
dependency: transitive
2022
description:
2123
name: characters
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "1.2.0"
25-
charcode:
26-
dependency: transitive
27-
description:
28-
name: charcode
29-
url: "https://pub.dartlang.org"
24+
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25+
url: "https://pub.dev"
3026
source: hosted
31-
version: "1.3.1"
27+
version: "1.3.0"
3228
clock:
3329
dependency: transitive
3430
description:
3531
name: clock
36-
url: "https://pub.dartlang.org"
32+
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33+
url: "https://pub.dev"
3734
source: hosted
38-
version: "1.1.0"
35+
version: "1.1.1"
3936
collection:
4037
dependency: transitive
4138
description:
4239
name: collection
43-
url: "https://pub.dartlang.org"
40+
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
41+
url: "https://pub.dev"
4442
source: hosted
45-
version: "1.15.0"
43+
version: "1.17.1"
4644
cupertino_icons:
4745
dependency: "direct main"
4846
description:
4947
name: cupertino_icons
50-
url: "https://pub.dartlang.org"
48+
sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5"
49+
url: "https://pub.dev"
5150
source: hosted
5251
version: "1.0.4"
5352
fake_async:
5453
dependency: transitive
5554
description:
5655
name: fake_async
57-
url: "https://pub.dartlang.org"
56+
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
57+
url: "https://pub.dev"
5858
source: hosted
59-
version: "1.2.0"
59+
version: "1.3.1"
6060
flutter:
6161
dependency: "direct main"
6262
description: flutter
@@ -66,56 +66,71 @@ packages:
6666
dependency: "direct dev"
6767
description:
6868
name: flutter_lints
69-
url: "https://pub.dartlang.org"
69+
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
70+
url: "https://pub.dev"
7071
source: hosted
7172
version: "1.0.4"
7273
flutter_test:
7374
dependency: "direct dev"
7475
description: flutter
7576
source: sdk
7677
version: "0.0.0"
78+
js:
79+
dependency: transitive
80+
description:
81+
name: js
82+
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
83+
url: "https://pub.dev"
84+
source: hosted
85+
version: "0.6.7"
7786
lints:
7887
dependency: transitive
7988
description:
8089
name: lints
81-
url: "https://pub.dartlang.org"
90+
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
91+
url: "https://pub.dev"
8292
source: hosted
8393
version: "1.0.1"
8494
matcher:
8595
dependency: transitive
8696
description:
8797
name: matcher
88-
url: "https://pub.dartlang.org"
98+
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
99+
url: "https://pub.dev"
89100
source: hosted
90-
version: "0.12.11"
101+
version: "0.12.15"
91102
material_color_utilities:
92103
dependency: transitive
93104
description:
94105
name: material_color_utilities
95-
url: "https://pub.dartlang.org"
106+
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
107+
url: "https://pub.dev"
96108
source: hosted
97-
version: "0.1.3"
109+
version: "0.2.0"
98110
meta:
99111
dependency: transitive
100112
description:
101113
name: meta
102-
url: "https://pub.dartlang.org"
114+
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
115+
url: "https://pub.dev"
103116
source: hosted
104-
version: "1.7.0"
117+
version: "1.9.1"
105118
path:
106119
dependency: transitive
107120
description:
108121
name: path
109-
url: "https://pub.dartlang.org"
122+
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
123+
url: "https://pub.dev"
110124
source: hosted
111-
version: "1.8.0"
125+
version: "1.8.3"
112126
plugin_platform_interface:
113127
dependency: transitive
114128
description:
115129
name: plugin_platform_interface
116-
url: "https://pub.dartlang.org"
130+
sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd"
131+
url: "https://pub.dev"
117132
source: hosted
118-
version: "2.1.2"
133+
version: "2.1.5"
119134
sky_engine:
120135
dependency: transitive
121136
description: flutter
@@ -125,86 +140,86 @@ packages:
125140
dependency: transitive
126141
description:
127142
name: source_span
128-
url: "https://pub.dartlang.org"
143+
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
144+
url: "https://pub.dev"
129145
source: hosted
130-
version: "1.8.1"
146+
version: "1.9.1"
131147
splitio:
132148
dependency: "direct main"
133149
description:
134150
path: ".."
135151
relative: true
136152
source: path
137-
version: "0.1.2"
153+
version: "0.1.6-rc.1"
138154
splitio_android:
139155
dependency: transitive
140156
description:
141157
path: "../../splitio_android"
142158
relative: true
143159
source: path
144-
version: "0.1.2"
160+
version: "0.1.6-rc.1"
145161
splitio_ios:
146162
dependency: transitive
147163
description:
148164
path: "../../splitio_ios"
149165
relative: true
150166
source: path
151-
version: "0.1.2"
167+
version: "0.1.6-rc.1"
152168
splitio_platform_interface:
153169
dependency: transitive
154170
description:
155171
path: "../../splitio_platform_interface"
156172
relative: true
157173
source: path
158-
version: "1.0.0"
174+
version: "1.3.0-rc.1"
159175
stack_trace:
160176
dependency: transitive
161177
description:
162178
name: stack_trace
163-
url: "https://pub.dartlang.org"
179+
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
180+
url: "https://pub.dev"
164181
source: hosted
165-
version: "1.10.0"
182+
version: "1.11.0"
166183
stream_channel:
167184
dependency: transitive
168185
description:
169186
name: stream_channel
170-
url: "https://pub.dartlang.org"
187+
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
188+
url: "https://pub.dev"
171189
source: hosted
172-
version: "2.1.0"
190+
version: "2.1.1"
173191
string_scanner:
174192
dependency: transitive
175193
description:
176194
name: string_scanner
177-
url: "https://pub.dartlang.org"
195+
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
196+
url: "https://pub.dev"
178197
source: hosted
179-
version: "1.1.0"
198+
version: "1.2.0"
180199
term_glyph:
181200
dependency: transitive
182201
description:
183202
name: term_glyph
184-
url: "https://pub.dartlang.org"
203+
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
204+
url: "https://pub.dev"
185205
source: hosted
186-
version: "1.2.0"
206+
version: "1.2.1"
187207
test_api:
188208
dependency: transitive
189209
description:
190210
name: test_api
191-
url: "https://pub.dartlang.org"
211+
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
212+
url: "https://pub.dev"
192213
source: hosted
193-
version: "0.4.8"
194-
typed_data:
195-
dependency: transitive
196-
description:
197-
name: typed_data
198-
url: "https://pub.dartlang.org"
199-
source: hosted
200-
version: "1.3.0"
214+
version: "0.5.1"
201215
vector_math:
202216
dependency: transitive
203217
description:
204218
name: vector_math
205-
url: "https://pub.dartlang.org"
219+
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
220+
url: "https://pub.dev"
206221
source: hosted
207-
version: "2.1.1"
222+
version: "2.1.4"
208223
sdks:
209-
dart: ">=2.16.2 <3.0.0"
224+
dart: ">=3.0.0-0 <4.0.0"
210225
flutter: ">=2.5.0"

splitio/lib/splitio.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ class Splitio {
3636
Splitio(this._sdkKey, this._defaultMatchingKey,
3737
{String? bucketingKey, SplitConfiguration? configuration}) {
3838
_defaultBucketingKey = bucketingKey;
39-
_splitConfiguration = configuration;
39+
if (configuration != null) {
40+
_splitConfiguration = configuration;
41+
} else {
42+
_splitConfiguration = SplitConfiguration();
43+
}
4044

4145
_init();
4246
}

splitio/pubspec.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: splitio
22
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.
3-
version: 0.1.5
3+
version: 0.1.6-rc.1
44
homepage: https://split.io/
55
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio/
66

@@ -19,9 +19,12 @@ flutter:
1919
dependencies:
2020
flutter:
2121
sdk: flutter
22-
splitio_android: ^0.1.5
23-
splitio_ios: ^0.1.5
24-
splitio_platform_interface: ^1.2.0
22+
splitio_android: #^0.1.6-rc.1
23+
path: ../splitio_android
24+
splitio_ios: #^0.1.6-rc.1
25+
path: ../splitio_ios
26+
splitio_platform_interface: #^1.3.0-rc.1
27+
path: ../splitio_platform_interface
2528

2629
dev_dependencies:
2730
flutter_test:

splitio/test/splitio_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main() {
1717
expect(_platform.methodArguments, {
1818
'apiKey': 'api-key',
1919
'matchingKey': 'matching-key',
20-
'sdkConfiguration': {}
20+
'sdkConfiguration': {'readyTimeout': 10}
2121
});
2222
});
2323

@@ -28,7 +28,7 @@ void main() {
2828
'apiKey': 'api-key',
2929
'matchingKey': 'matching-key',
3030
'bucketingKey': 'bucketing-key',
31-
'sdkConfiguration': {}
31+
'sdkConfiguration': {'readyTimeout': 10}
3232
});
3333
});
3434

@@ -42,7 +42,7 @@ void main() {
4242
'apiKey': 'api-key',
4343
'matchingKey': 'matching-key',
4444
'bucketingKey': 'bucketing-key',
45-
'sdkConfiguration': {'logLevel': 'debug', 'streamingEnabled': false},
45+
'sdkConfiguration': {'logLevel': 'debug', 'streamingEnabled': false, 'readyTimeout': 10},
4646
});
4747
});
4848
});
@@ -118,7 +118,7 @@ void main() {
118118
expect(_platform.methodArguments, {
119119
'matchingKey': 'matching-key',
120120
'apiKey': 'api-key',
121-
'sdkConfiguration': {},
121+
'sdkConfiguration': {'readyTimeout': 10},
122122
'value': true,
123123
});
124124
});

splitio_android/android/src/main/java/io/split/splitio/SplitClientConfigHelper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.HashMap;
77
import java.util.List;
88
import java.util.Map;
9+
import java.util.concurrent.TimeUnit;
910

1011
import io.split.android.client.ServiceEndpoints;
1112
import io.split.android.client.SplitClientConfig;
@@ -43,6 +44,7 @@ class SplitClientConfigHelper {
4344
private static final String USER_CONSENT = "userConsent";
4445
private static final String ENCRYPTION_ENABLED = "encryptionEnabled";
4546
private static final String LOG_LEVEL = "logLevel";
47+
private static final String READY_TIMEOUT = "readyTimeout";
4648

4749
/**
4850
* Creates a {@link SplitClientConfig} object from a map.
@@ -206,6 +208,11 @@ static SplitClientConfig fromMap(@NonNull Map<String, Object> configurationMap,
206208
}
207209
}
208210

211+
Integer readyTimeout = getInteger(configurationMap, READY_TIMEOUT);
212+
if (readyTimeout != null) {
213+
builder.ready((int) TimeUnit.SECONDS.toMillis(readyTimeout)); // Android SDK uses this parameter in millis
214+
}
215+
209216
return builder.serviceEndpoints(serviceEndpointsBuilder.build()).build();
210217
}
211218

splitio_android/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: splitio_android
22
description: The official Android implementation of splitio Flutter plugin.
33
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio_android
4-
version: 0.1.5
4+
version: 0.1.6-rc.1
55

66
environment:
77
sdk: ">=2.16.2 <4.0.0"
@@ -19,7 +19,8 @@ flutter:
1919
dependencies:
2020
flutter:
2121
sdk: flutter
22-
splitio_platform_interface: ^1.2.0
22+
splitio_platform_interface: #^1.3.0-rc.1
23+
path: ../splitio_platform_interface
2324

2425
dev_dependencies:
2526
flutter_test:

0 commit comments

Comments
 (0)