Skip to content

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

Closed
firebase/flutterfire
#28
@IchordeDionysos

Description

@IchordeDionysos

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 ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions