Skip to content

[firebase_remote_config] RemoteConfig.instance Future already completed #120

Description

@IchordeDionysos

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

Activity

  1. IchordeDionysos commented on Sep 9, 2019

    @IchordeDionysos
    ContributorAuthor

    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.

  2. mayurdhurpate commented on Nov 29, 2019

    @mayurdhurpate

    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?

  3. stepankuzmin commented on Dec 24, 2019

    @stepankuzmin

    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 ☹️

  4. added
    impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)
    on Apr 23, 2020
  5. Praveen-Pandiyan commented on Jul 30, 2020

    @Praveen-Pandiyan

    this problem occurs only when i am using MVC architecture.

  6. michaldev commented on Aug 31, 2020

    @michaldev

    I have the same problem.

  7. albertpurnama commented on Nov 12, 2020

    @albertpurnama

    I'm experiencing the same problem!

  8. Salakar commented on Apr 1, 2021

    @Salakar
    Contributor

    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.

  9. IchordeDionysos commented on Apr 1, 2021

    @IchordeDionysos
    ContributorAuthor

    Ah yes, forgot to close this issue.

    This is definitely fixed with the new version!

  10. locked and limited conversation to collaborators on May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)plugin: remote_configtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions