-
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
fix(auth): add scheduler to schedule onAuth events through Angular zone #368
Conversation
authCb = null; | ||
backend = new FirebaseSdkAuthBackend(app); | ||
})(); | ||
var mockNgZone = Zone.current.fork({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment on why you need to wrap the code in a zone. What exactly needs to be wrapped ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code actually doesn't need to be run in a zone. I should fork the zone in the spec that checks the zone to make sure the subscription callback isn't in the <root>
zone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean an inline comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know; I'm saying this code is not actually necessary.
As discussed, please add a TODO comment to the code to fix the this properly. Is anyone working on a solution ? |
@vicb I'm working on addressing the bigger issue with Zone+Rx outside of this. But for now I changed the PR to wrap the subscriber functions at subscribe time. |
@@ -112,3 +111,10 @@ export class FirebaseSdkAuthBackend extends AuthBackend { | |||
} | |||
} | |||
} | |||
|
|||
function wrapSubscriberMethods<T>(obs: Observer<T>): Observer<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment in the code
Please add comments to the code for maintainabilty. LGTM once the comments are adressed |
1778ed3
to
7fb596e
Compare
I'm going to make |
Closes #354