Skip to content
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

Remote Config fails with Future already complete with two RemoteConfig.instance #38060

Closed
IchordeDionysos opened this issue Aug 10, 2019 · 1 comment · Fixed by firebase/flutterfire#28

Comments

@IchordeDionysos
Copy link
Contributor

Steps to Reproduce

  1. Install and configure Remote Config
  2. Get RemoteConfig.instance twice in parallel
  3. See that the second call will fail with Bad state: Future already completed

Cause of the bug

When getting the RemoteConfig.instance the source code here checks whether the instance was already retrieved.

When calling RemoteConfig.instance twice both of these calls go into the if-statement and try to retrieve the instance.

Then in here both calls to get RemoteConfig.instance try to complete with the instance, but the second one fails as the first one already completed the Completer.

Logs

I hope you don't mind if I did not include any logs here as the fix is pretty obvious ;)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant