-
Notifications
You must be signed in to change notification settings - Fork 3k
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(Observable/Ajax): mount properties to origin readystatechange fn #2025
Conversation
5359b02
to
00fc6b1
Compare
72b778e
to
4f2f376
Compare
38938f9
to
0e034dc
Compare
ea6cb9f
to
3466354
Compare
@Brooooooklyn ... I'm struggling to understand the issue. I think I get it... but can you create a test case as part of this PR that definitively shows the issue this is trying to correct? You don't need to use zones, maybe just monkey patch the handler or something? It seems if there's a problem like this, the alternative solution would be to use the |
@Blesh Indeed the issue is that zone.js does not respect the identity of the function you assign to the event callbacks. It wraps the function here so a new function created internally is the one you actually receive when we IMO is solution is acceptable and effectively the same we'd need to do if we used |
@Blesh I've added some test in a separate commit, could you please review it. |
Oh. I understand. Not sure why it wasn't sinking in the first time I looked at it. |
LGTM |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
xhr.onreadystatechange property may be monkey patched by other library such as
zone.js
.It would cause AjaxObservable could not find
subscriber
,progressSubscriber
andrequest
property on xhr.onreadystatechange.it's a simple example here: http://plnkr.co/edit/oX1v8tTjTog1T57Z0JnI?p=preview