Skip to content

🐛 [firebase_auth] userChanges() stream old data after linkWithCredential on chrome #8856

Closed
@matheus-kirchesch-old

Description

@matheus-kirchesch-old

Bug report

Describe the bug
userChanges is streamed when we call linkWithCredential on the user, and it works fine on android, but when on chrome it streams data before the link happens, so if you check if the user isAnonymous on a listener you will see it will still be anonymous

Steps to reproduce

  1. Initialize firebase as you would
  2. Listen to the userChanges stream FirebaseAuth.instance.userChanges().listen((event) { print("User updated: ${event}"); });
  3. SignIn anonymously auth.FirebaseAuth.instance.signInAnonymously();
  4. Link the anonymous account auth.FirebaseAuth.instance.currentUser!.linkWithCredential(EmailAuthProvider.credential(email: "[email protected]", password: "dasdsadsa",),);
  5. Now build for android and see it working as expected
  6. Then build for chrome and see that after linking the account you will receive an update on the stream but the account they give you on the stream will still not be linked

Expected behavior

For the stream be updated after the user get linked not before

Sample project

Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix.
Please link to the public repository URL.


Additional context

Add any other context about the problem here.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
PASTE OUTPUT INSIDE HERE

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
PASTE OUTPUT INSIDE HERE

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleIssue with no recent activityclosed-by-botplatform: webIssues / PRs which are specifically for web.plugin: authresolution: fixedA fix has been merged or is pending merge from a PR.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions