-
Notifications
You must be signed in to change notification settings - Fork 909
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
Not compatible with Angular #119
Comments
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information. |
The library is widely used with Angular. There is an angular library angularfire dedicated for this. This is the first time I hear of this issue. Can you elaborate more on how to reproduce this. |
I'm using Angular 4.3.2 with angularfire2 4.0.0-rc.1 and firebase 4.2.0. The problem appears as soon as I inject AngularFireAuth in one of my services. A setInterval is registered by the firebase library, causing Angular to refresh every second. |
There is the same issue opened in the angularfire2 project (angular/angularfire#1037) but I think the problem comes from the firebase library. I may be wrong. |
Don't know why, but after I restarted my laptop, the problem has gone away. Issue can be close then, sorry for that. |
Hi again, I've been able to reproduce the problem in a plunkr. It seems that the issue only appears with a mobile:
This behavior is indeed not comptabile with angular because it affects the performances in a really bad way, especially on a mobile. |
@bojeil-google I was able to repro his issue. Can you take a look? |
For certain mobile environments, I need the setInterval (I can't clear it as it will break stuff). I don't understand how angularJS works internally and why this could cause this. I need to be able to query storage for changes in certain mobile browsers and I can't clear that otherwise stuff break. |
@xtazy I was fiddled around with your plunkr and was able to reproduce the issue w/o Firebase leading me to believe this is actually an Angular issue. Take a look at https://plnkr.co/edit/NLKhh0Q9XsTNSjuBKvbm?p=preview I was able to remove the firebase inclusion and repro the issue with a This is an issue but you'll probably want to file this at https://github.com/angular/angular |
@bojeil-google It's Angular, not AngularJS I'm pretty confident a setInterval will trigger ngDoCheck, the question is why is there one in firebase and why would it happen only in mobile mode ??? I really don't think this is needed or that there is an other way to do it. setInterval is often a bad practice and creates performance issues. If you run your setInterval outside zonejs (angular wise) it should not trigger ngDoCheck anymore. |
Again, this is by design. Some mobile browsers have problems detecting a localStorage change when a window is in the background. This is needed to make sure it works if 'storage' event is not detected. The setInterval is not going away. |
Why not make it optional then? |
What do you mean, make it optional? So I should tell developers that signInWithPopup working in a mobile environment is optional? |
If the setInterval is gonna stay then this library is not compatible with Angular. Having a view check every second is not acceptable on a mobile. |
@xtazy, @Ploppy3 thanks a bunch for your interest in making this work well! Just wanted to give a little more context of what is going on. The calls to The Auth SDK currently is compensating for a deficiency found in Android browsers around the There are some potential workarounds (cc @davideast), but the limitation you've pointed out is a limitation of any library that uses any of the async invocation methods (i.e. Though we could remove the |
Would it be possible to run the |
@Maistho |
Hello,
I don't think the library is compatible with Angular: in the src/auth.build.js file, there is a setInterval that is registered causing Angular to trigger a refresh of its view every second.
Is it wanted? Is there a way to avoid this?
Best regards.
The text was updated successfully, but these errors were encountered: