-
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
ApplicationRef.isStable never goes to "true" when an instance of AngularFireAuth is injected #1347
Comments
I'm actually tackling right now. Thanks for the report! |
Once patched I'll cut a new RC. |
I have a somewhat different issue, seems like return ApplicationRef; never got executed. I'm new to angularfire2, can someone offer some good use cases for using angularfire2? |
…el implementalva gyors javitast helyeztunk el benne angular/angularfire#1347
The same issue when I injects |
jep, same issue here. |
I am having the same issue when injecting AngularFirestore |
Any updates on this issue? |
I am seeing this as well. It is being tracked in angular/angular#20970 where I added a full reproduction repo on GitHub. It's possible that angular/zone.js#999 may solve this, but it's still waiting on a review. Update: I tested the PR (angular/zone.js#999) but it didn't help in my case. |
From @JiaLiPassion " I'm not sure how we could disable Firebase Auth from doing this so that AngularFire2 could do it in an Angular-friendly way, but this will be a problem for integration testing as well as Service Worker registration. @jamesdaniels is anyone on the Firebase team able to look into this? For anyone blocked on the Service Worker registration, you can manually call |
angularfire2 cannot leave RC stage until this is fixed. |
Fixed in rc7 |
The issue persists in the Auth module. After you login some By using a so called When I put this inside the
The tests will run fine, because that particular task is no longer blocking the stable state of the angular zone, but also that task no longer exists, and I don't know how important it is ;). Apparently some calls inside the |
After a little more digging I found that the problem is originating from the This is at least triggered on login with using just email and password, or by using the For now the workaround is whenever you call these functions is to wrap it inside a |
Just talking with myself here, I managed to work around it by having to override the
And have this:
This will make sure the |
Thanks @PierreDuc! I can confirm the run outside zone method works as intended. I'm not using angular fire but it fixes it with |
Thanks for finding that problem. I had incorrectly assumed switchMap
would've stayed in the outer zone, I'll patch for the next RC.
…On Thu, May 31, 2018, 4:04 PM Ed Pelc ***@***.***> wrote:
Thanks @PierreDuc <https://github.com/PierreDuc>! I can confirm the run
outside zone method works as intended. I'm not using angular fire but it
fixes it with interval from rxjs since it's the same idea.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1347 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACvrxI76CsS67UUQ_K-JT7X0bvUJhOfks5t4Hb3gaJpZM4QjZYY>
.
|
@jamesdaniels The problem is that the observable I didn't have the time to figure out which of the calls trigger it, but I'm sure that at least |
@PierreDuc, maybe the problem is |
@JiaLiPassion well, the issue is a long lasting To reproduce a repo, I have to set-up a mock firebase app, where you can register and login. Don't think I have time soon to make something like that |
@PierreDuc , ok, I know about the if (task.type === 'macroTask' && task.data.delay > 3200000 && task.data.delay < 3400000) {
setTimeout(() => {
Zone.current.cancelTask(task);
});
}` Maybe there is a better way to solve this one, if this onScheduleTask: (delegate, curr, target, task) => {
if ( task.source === 'setTimeout' && task.data.delay > 3200000 && task.data.delay < 3400000) {
task.cancelScheduleRequest();
task = Zone.root.scheduleTask(task);
return task;
}
return delegate.scheduleTask(target, task);
} |
@JiaLiPassion Ah, but that's just in an additional test class called a But yes instead of overriding the AngularFireAuth, I could implement it like this, just in the e2e, although I don't really want something like this in my specs. It will make the e2e code different from the production code. |
@PierreDuc , got it, I believe in |
This issue should be reopened. Angular9 + AngularFire6 has same issue. |
@JeongJun-Lee it would be appropriate to open a new issue in that case. You may want to look into https://angular.io/api/service-worker/SwRegistrationOptions as that allows you to register a SW without waiting for |
i am developing a plugin to ignore such special async tasks. angular/protractor#4584 (comment) would be nice, if community supports me with pr and tests/issues for your use-cases. |
When
AngularFireAuth
is injected anywhere on the page, theApplicationRef.isStable
never emitstrue
. This causes problems with latest@angular/service-worker
, which relies onApplicationRef.isStable
to install the worker. This probably also would cause server-side rendering to timeout, but I didn't test this.Version info
Angular: 5.0.0
Firebase: 4.6.2
AngularFire: 5.0.0-rc4
How to reproduce these conditions
Inject
AngularFireAuth
into a component and subscribe to theApplicationRef.isStable
observable:Here is a project that reproduces the problem: https://stackblitz.com/edit/angularfire2-appref-isstable
Expected behavior
The
ApplicationRef.isStable
observable should emittrue
shortly after application is loaded.Actual behavior
The
ApplicationRef.isStable
observable emits only initialfalse
value.The text was updated successfully, but these errors were encountered: