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

[firebase_remote_config] RemoteConfig.instance Future already completed #120

Closed
IchordeDionysos opened this issue Sep 9, 2019 · 8 comments
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: remote_config type: bug Something isn't working

Comments

@IchordeDionysos
Copy link
Contributor

IchordeDionysos commented Sep 9, 2019

Describe the bug
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.

To Reproduce
Steps to reproduce the behavior:

  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

Expected behavior
Both calles to RemoteConfig.instance complete without an error

Additional context

I'll put together an MVCE

@IchordeDionysos IchordeDionysos added the type: bug Something isn't working label Sep 9, 2019
@IchordeDionysos
Copy link
Contributor Author

Here is the MCVE: https://gist.github.com/IchordeDionysos/849d1ec5ec409487f1f2640c9c806e9f
If you run it in Debug mode you'll stop at the Future already complete error.

Of course, this example seems a bit useless, but consider the second RemoteConfig.instance being called somewhere else in the source code independent from the first call.

@mayurdhurpate
Copy link

mayurdhurpate commented Nov 29, 2019

Facing the same issue Unhandled Exception: Bad state: Future already completed if running:
final RemoteConfig remoteConfig = await RemoteConfig.instance; multiple times in parent-child widgets at the same time. Any workarounds?

@stepankuzmin
Copy link

Facing the same issue Unhandled Exception: Bad state: Future already completed if running:
final RemoteConfig remoteConfig = await RemoteConfig.instance; multiple times in parent-child widgets at the same time. Any workarounds?

Same issue here ☹️

@Praveen-Pandiyan
Copy link

this problem occurs only when i am using MVC architecture.

@michaldev
Copy link

I have the same problem.

@albertpurnama
Copy link

albertpurnama commented Nov 12, 2020

I'm experiencing the same problem!

@Salakar
Copy link
Member

Salakar commented Apr 1, 2021

Given the age of this issue and that Remote Config has had a major rework since; I'm going to close this issue in favour of trying the latest release.

@Salakar Salakar closed this as completed Apr 1, 2021
@IchordeDionysos
Copy link
Contributor Author

Ah yes, forgot to close this issue.

This is definitely fixed with the new version!

@firebase firebase locked and limited conversation to collaborators May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: remote_config type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants