-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
AngularFireAuth.authState
does not fire
#2309
Comments
Same issue here. Seems to fire randomly, or after a few seconds during testing. |
I do having this issue, how to fix this? |
Seeing same issue with the authState observable not being fired when subscribed to. Just upgraded: |
Same issue here. |
Same here :D |
Should be addressed in |
It does not fix this 😉. That's the reason why this issue and #2307 are separated. |
@jamesdaniels It seems that I can't reopen this issue. Lol |
I've been able to create a simpler reproduction here: https://stackblitz.com/edit/angular-bk3qb6 |
I've also noticed that changing to But, if you change both I think this is may be due to how both fields is constructed. Lines 50 to 56 in 168077b
I'm thinking |
Just killed my last comment since I've found the root cause and I was going down the wrong path. It seems something about the new Zone refactors is breaking multiplexing. |
It seems to be forcing a share, where one shouldn't exist, even if you use a different factory. This came up in review but I thought it was addressed. |
Since it's shared without replay, the second subscribe gets no result until a change comes through; since it's not creating a new observable. If I don't have a fix quickly I'll revert the zone memory leaks in a patch. Thanks so much for catching this! |
Demonstrating the break fix/here https://stackblitz.com/edit/angular-7kb1uf?file=src%2Fapp%2Fapp.component.ts |
This issue still present in 5.4.1 also. |
Fixed in |
Updated to 5.4.2, looks fixed on my end, running: "@angular/fire": "^5.4.2", Thanks for the quick fix! |
I think it not working in "@angular/fire": "^6.0.0". Could you please look into this? |
Version info
Angular: 8.2.14
Firebase: 7.8.0
AngularFire: 5.4.0-5.4.1
Other (e.g. Ionic/Cordova, Node, browser, operating system):
How to reproduce these conditions
Failing test unit, Plunkr, or JSFiddle demonstrating the problem: https://stackblitz.com/edit/angular-lgfgbl
Steps to set up and reproduce
app.module.ts
Sample data and security rules: none
Debug output
** Errors in the JavaScript console **: none
** Output from
firebase.database().enableLogging(true);
**: not applicable** Screenshots **
Expected behavior
After redirected back from sign-in, you should be automatically to
/main
path.Actual behavior
The app does not redirect you to
/main
path. (It does in@angular/fire@5.3.1
.)My observation
If I remove the line
this.user$ = this.afa.authState;
out fromapp.component.ts
, it works! Doesn't know why.The text was updated successfully, but these errors were encountered: