-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Wrapping XMLHttpRequest#open()
built in sensitive to order.
#453
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yeah, you're right. I wrapped |
Ah, I think this might be related to what I was encountering. I believe I'll definitely re-explore this pronto and see if we can get the right behavior in place for 2.1.0. |
Cheers Ben 👍 :) |
Wrap XMLHttp.prototype.send instead of open (fixes #453)
Thanks for all the hard work you all do. Our team has enjoyed using Sentry and Raven.
I was finishing an upgrade to 1.3.0 and noticed a 2.0.1 release and took the plunge since we would be able to remove our own built in wrapper plugin.
Reading the Raven implementation it looks like you all are wrapping
open()
. You're probably aware this requires the consumer to define their event handlers before callingopen()
while the object's interface doesn't impose order for async requests.jQuery for example calls
open()
before defining event handlers. It's not a jQuery-thing at the core, it's just super simple to miss out on Raven's wrapping due to flexibility of theXMLHttpRequest
interface.Our team opted to target
send()
and wrap the event handler asynchronously. This has seemed to handle any order of callingsend()
,open()
and defining the event handlers. Of course it relies on the request being async.Regardless thanks again for the tool. Feel free to nod and close or run with it. Cheers!
The text was updated successfully, but these errors were encountered: