firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.56k stars 1.45k forks source link

Unlinking a user with user.unlink(fromProvider:) from Apple provider does not trigger IDTokenDidChangeListenerHandle #8077

Open shawnkoh opened 3 years ago

shawnkoh commented 3 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

Unlinking a user with user.unlink(fromProvider:) from Apple provider does not trigger IDTokenDidChangeListenerHandle.

Steps to reproduce:

  1. Create a listener with addIDTokenDidChangeListener and store a reference to it. Add a print statement inside the listener's closure.
  2. Create an anonymous user
  3. Sign in with Apple
  4. Calculate Credential from ASAuthorization
  5. Call user.link(with: credential) IDTokenDidChangeListenerHandle will fire (as observed by the print statement)
  6. Call user.unlink(fromProvider: "apple.com") IDTokenDidChangeListenerHandle will NOT fire (as observed by the lack of a print statement).

Related issues and pull requests:

245

249

325

weixifan commented 3 years ago

Thank you for filing this. I've filed an internal issue b/188591834 to track.