Skip to content

fix(Config-update): Fix issues with config-update listener. #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
* addActivateNotificationListener
* addTrackNotificationListener
* addLogEventNotificationListener
* addUpdateConfigNotificationListener
* addConfigUpdateNotificationListener

### **Documentation will be available soon in final release**
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected void initializeOptimizely(@NonNull ArgumentsParser argumentsParser, @N
.build();

// Datafile Download Interval
long datafilePeriodicDownloadInterval = 10 * 60; // seconds
long datafilePeriodicDownloadInterval = 15 * 60; // seconds

if (argumentsParser.getDatafilePeriodicDownloadInterval() != null) {
datafilePeriodicDownloadInterval = argumentsParser.getDatafilePeriodicDownloadInterval();
Expand Down
2 changes: 1 addition & 1 deletion lib/optimizely_flutter_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class OptimizelyFlutterSdk {
///
/// Takes [callback] A [MultiUseCallback] notification handler to be added.
/// Returns [int] Id of registered listener that allows the user to remove the added notification listener.
Future<int> addUpdateConfigNotificationListener(
Future<int> addConfigUpdateNotificationListener(
MultiUseCallback callback) async {
return await _addConfigUpdateNotificationListener(callback);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Constants {
static const String decisionCallBackListener = "decisionCallbackListener";
static const String logEventCallbackListener = "logEventCallbackListener";
static const String configUpdateCallBackListener =
"projectConfigUpdateCallBackListener";
"projectConfigUpdateCallbackListener";

// OptimizelyConfig Request params
static const String audiences = "audiences";
Expand Down
32 changes: 16 additions & 16 deletions test/optimizely_flutter_sdk_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ void main() {
};
await sdk.addDecisionNotificationListener(callback);
await sdk.addLogEventNotificationListener(callback);
await sdk.addUpdateConfigNotificationListener(callback);
await sdk.addConfigUpdateNotificationListener(callback);
await sdk.addTrackNotificationListener(callback);
await sdk.addActivateNotificationListener(callback);
var callHandler = OptimizelyClientWrapper.methodCallHandler;
Expand All @@ -716,7 +716,7 @@ void main() {
await sdk.addLogEventNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addTrackNotificationListener((msg) {
Expand Down Expand Up @@ -767,10 +767,10 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -830,7 +830,7 @@ void main() {
await sdk1.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk1.addUpdateConfigNotificationListener((msg) {
await sdk1.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk1.addActivateNotificationListener((msg) {
Expand All @@ -846,7 +846,7 @@ void main() {
await sdk2.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk2.addUpdateConfigNotificationListener((msg) {
await sdk2.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk2.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -905,7 +905,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand All @@ -920,7 +920,7 @@ void main() {
notifications.add(msg);
});
await sdk.removeNotificationListener(id);
id = await sdk.addUpdateConfigNotificationListener((msg) {
id = await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.removeNotificationListener(id);
Expand Down Expand Up @@ -974,7 +974,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -1016,7 +1016,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -1058,7 +1058,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -1100,7 +1100,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -1141,7 +1141,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -1182,7 +1182,7 @@ void main() {
await sdk.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addUpdateConfigNotificationListener((msg) {
await sdk.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk.addActivateNotificationListener((msg) {
Expand Down Expand Up @@ -1245,7 +1245,7 @@ void main() {
await sdk1.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk1.addUpdateConfigNotificationListener((msg) {
await sdk1.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk1.addActivateNotificationListener((msg) {
Expand All @@ -1261,7 +1261,7 @@ void main() {
await sdk2.addTrackNotificationListener((msg) {
notifications.add(msg);
});
await sdk2.addUpdateConfigNotificationListener((msg) {
await sdk2.addConfigUpdateNotificationListener((msg) {
notifications.add(msg);
});
await sdk2.addActivateNotificationListener((msg) {
Expand Down