Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[firebase_remote_config] Fix Future already completed RemoteConfig.instance #1966

Closed
wants to merge 4 commits into from
Closed
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
5 changes: 5 additions & 0 deletions packages/firebase_remote_config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.0+6

* Fix `Bad state: Future already completed` error when initially
calling `RemoteConfig.instance` multiple times in parallel.

## 0.2.0+5

* Update google-services Android gradle plugin to 4.3.0 in documentation and examples.
Expand Down
4 changes: 3 additions & 1 deletion packages/firebase_remote_config/lib/src/remote_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class RemoteConfig extends ChangeNotifier {
instance._remoteConfigSettings = remoteConfigSettings;
instance._parameters =
_parseRemoteConfigParameters(parameters: properties['parameters']);
_instanceCompleter.complete(instance);
if (!_instanceCompleter.isCompleted) {
_instanceCompleter.complete(instance);
}
}

static Map<String, RemoteConfigValue> _parseRemoteConfigParameters(
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_remote_config/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Remote Config. Update your application
re-releasing.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_remote_config
version: 0.2.0+5
version: 0.2.0+6

dependencies:
flutter:
Expand Down