Skip to content

Commit f0899c8

Browse files
fix(Config-update): Fix issues with config-update listener. (#42)
* fixing configupdate notification bug. * Setting default datafile fetch interval to 15 minutes Co-authored-by: mnoman09 <[email protected]>
1 parent bd737b0 commit f0899c8

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
* addActivateNotificationListener
3030
* addTrackNotificationListener
3131
* addLogEventNotificationListener
32-
* addUpdateConfigNotificationListener
32+
* addConfigUpdateNotificationListener
3333

3434
### **Documentation will be available soon in final release**

android/src/main/java/com/optimizely/optimizely_flutter_sdk/OptimizelyFlutterClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected void initializeOptimizely(@NonNull ArgumentsParser argumentsParser, @N
105105
.build();
106106

107107
// Datafile Download Interval
108-
long datafilePeriodicDownloadInterval = 10 * 60; // seconds
108+
long datafilePeriodicDownloadInterval = 15 * 60; // seconds
109109

110110
if (argumentsParser.getDatafilePeriodicDownloadInterval() != null) {
111111
datafilePeriodicDownloadInterval = argumentsParser.getDatafilePeriodicDownloadInterval();

lib/optimizely_flutter_sdk.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class OptimizelyFlutterSdk {
226226
///
227227
/// Takes [callback] A [MultiUseCallback] notification handler to be added.
228228
/// Returns [int] Id of registered listener that allows the user to remove the added notification listener.
229-
Future<int> addUpdateConfigNotificationListener(
229+
Future<int> addConfigUpdateNotificationListener(
230230
MultiUseCallback callback) async {
231231
return await _addConfigUpdateNotificationListener(callback);
232232
}

lib/src/utils/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Constants {
8585
static const String decisionCallBackListener = "decisionCallbackListener";
8686
static const String logEventCallbackListener = "logEventCallbackListener";
8787
static const String configUpdateCallBackListener =
88-
"projectConfigUpdateCallBackListener";
88+
"projectConfigUpdateCallbackListener";
8989

9090
// OptimizelyConfig Request params
9191
static const String audiences = "audiences";

test/optimizely_flutter_sdk_test.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ void main() {
691691
};
692692
await sdk.addDecisionNotificationListener(callback);
693693
await sdk.addLogEventNotificationListener(callback);
694-
await sdk.addUpdateConfigNotificationListener(callback);
694+
await sdk.addConfigUpdateNotificationListener(callback);
695695
await sdk.addTrackNotificationListener(callback);
696696
await sdk.addActivateNotificationListener(callback);
697697
var callHandler = OptimizelyClientWrapper.methodCallHandler;
@@ -716,7 +716,7 @@ void main() {
716716
await sdk.addLogEventNotificationListener((msg) {
717717
notifications.add(msg);
718718
});
719-
await sdk.addUpdateConfigNotificationListener((msg) {
719+
await sdk.addConfigUpdateNotificationListener((msg) {
720720
notifications.add(msg);
721721
});
722722
await sdk.addTrackNotificationListener((msg) {
@@ -767,10 +767,10 @@ void main() {
767767
await sdk.addTrackNotificationListener((msg) {
768768
notifications.add(msg);
769769
});
770-
await sdk.addUpdateConfigNotificationListener((msg) {
770+
await sdk.addConfigUpdateNotificationListener((msg) {
771771
notifications.add(msg);
772772
});
773-
await sdk.addUpdateConfigNotificationListener((msg) {
773+
await sdk.addConfigUpdateNotificationListener((msg) {
774774
notifications.add(msg);
775775
});
776776
await sdk.addActivateNotificationListener((msg) {
@@ -830,7 +830,7 @@ void main() {
830830
await sdk1.addTrackNotificationListener((msg) {
831831
notifications.add(msg);
832832
});
833-
await sdk1.addUpdateConfigNotificationListener((msg) {
833+
await sdk1.addConfigUpdateNotificationListener((msg) {
834834
notifications.add(msg);
835835
});
836836
await sdk1.addActivateNotificationListener((msg) {
@@ -846,7 +846,7 @@ void main() {
846846
await sdk2.addTrackNotificationListener((msg) {
847847
notifications.add(msg);
848848
});
849-
await sdk2.addUpdateConfigNotificationListener((msg) {
849+
await sdk2.addConfigUpdateNotificationListener((msg) {
850850
notifications.add(msg);
851851
});
852852
await sdk2.addActivateNotificationListener((msg) {
@@ -905,7 +905,7 @@ void main() {
905905
await sdk.addTrackNotificationListener((msg) {
906906
notifications.add(msg);
907907
});
908-
await sdk.addUpdateConfigNotificationListener((msg) {
908+
await sdk.addConfigUpdateNotificationListener((msg) {
909909
notifications.add(msg);
910910
});
911911
await sdk.addActivateNotificationListener((msg) {
@@ -920,7 +920,7 @@ void main() {
920920
notifications.add(msg);
921921
});
922922
await sdk.removeNotificationListener(id);
923-
id = await sdk.addUpdateConfigNotificationListener((msg) {
923+
id = await sdk.addConfigUpdateNotificationListener((msg) {
924924
notifications.add(msg);
925925
});
926926
await sdk.removeNotificationListener(id);
@@ -974,7 +974,7 @@ void main() {
974974
await sdk.addTrackNotificationListener((msg) {
975975
notifications.add(msg);
976976
});
977-
await sdk.addUpdateConfigNotificationListener((msg) {
977+
await sdk.addConfigUpdateNotificationListener((msg) {
978978
notifications.add(msg);
979979
});
980980
await sdk.addActivateNotificationListener((msg) {
@@ -1016,7 +1016,7 @@ void main() {
10161016
await sdk.addTrackNotificationListener((msg) {
10171017
notifications.add(msg);
10181018
});
1019-
await sdk.addUpdateConfigNotificationListener((msg) {
1019+
await sdk.addConfigUpdateNotificationListener((msg) {
10201020
notifications.add(msg);
10211021
});
10221022
await sdk.addActivateNotificationListener((msg) {
@@ -1058,7 +1058,7 @@ void main() {
10581058
await sdk.addTrackNotificationListener((msg) {
10591059
notifications.add(msg);
10601060
});
1061-
await sdk.addUpdateConfigNotificationListener((msg) {
1061+
await sdk.addConfigUpdateNotificationListener((msg) {
10621062
notifications.add(msg);
10631063
});
10641064
await sdk.addActivateNotificationListener((msg) {
@@ -1100,7 +1100,7 @@ void main() {
11001100
await sdk.addTrackNotificationListener((msg) {
11011101
notifications.add(msg);
11021102
});
1103-
await sdk.addUpdateConfigNotificationListener((msg) {
1103+
await sdk.addConfigUpdateNotificationListener((msg) {
11041104
notifications.add(msg);
11051105
});
11061106
await sdk.addActivateNotificationListener((msg) {
@@ -1141,7 +1141,7 @@ void main() {
11411141
await sdk.addTrackNotificationListener((msg) {
11421142
notifications.add(msg);
11431143
});
1144-
await sdk.addUpdateConfigNotificationListener((msg) {
1144+
await sdk.addConfigUpdateNotificationListener((msg) {
11451145
notifications.add(msg);
11461146
});
11471147
await sdk.addActivateNotificationListener((msg) {
@@ -1182,7 +1182,7 @@ void main() {
11821182
await sdk.addTrackNotificationListener((msg) {
11831183
notifications.add(msg);
11841184
});
1185-
await sdk.addUpdateConfigNotificationListener((msg) {
1185+
await sdk.addConfigUpdateNotificationListener((msg) {
11861186
notifications.add(msg);
11871187
});
11881188
await sdk.addActivateNotificationListener((msg) {
@@ -1245,7 +1245,7 @@ void main() {
12451245
await sdk1.addTrackNotificationListener((msg) {
12461246
notifications.add(msg);
12471247
});
1248-
await sdk1.addUpdateConfigNotificationListener((msg) {
1248+
await sdk1.addConfigUpdateNotificationListener((msg) {
12491249
notifications.add(msg);
12501250
});
12511251
await sdk1.addActivateNotificationListener((msg) {
@@ -1261,7 +1261,7 @@ void main() {
12611261
await sdk2.addTrackNotificationListener((msg) {
12621262
notifications.add(msg);
12631263
});
1264-
await sdk2.addUpdateConfigNotificationListener((msg) {
1264+
await sdk2.addConfigUpdateNotificationListener((msg) {
12651265
notifications.add(msg);
12661266
});
12671267
await sdk2.addActivateNotificationListener((msg) {

0 commit comments

Comments
 (0)