You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Client tracker does not process aboting his 'pullCallbacks' requests #5
3.Click on added link
Result: Aladin is started, but client tracker does not show it in list.
Cause: Request 'pullCallbacks' was cancelled by browser. but samp XmlRpcClient does not have 'onabort' handler and can't recover.
I suggest to patch it like this, but not sure about different implementations of Xhr used in samp.js
@AnotherOneAckap, I'm having trouble reproducing this - mostly the list updates correctly for me, though I think I did see the failure happen once. Unfortunately, I write javascript just infrequently enough that I forget it all between times, so I'm not totally on top of what's going on here.
There's at least a couple of things I don't understand. Can you explain in more detail what goes wrong as the result of the lack of an abort handler? I've written in the comments that abort is ignored, which I thought was reasonable, but if it's causing trouble clearly it needs a fix. Secondly, your suggested fix above says xhr.xhr.onabort - is that what you mean, or should it just be xhr.onabort? It looks to me that something like xhr.onabort = xhr.onerror might do the trick, but I still don't fully understand the problem.
@mbtaylor, You can see bug in action on http://ocl.sai.msu.ru/
1.Use menu in left top corner to connect to hub. (I used Google Chrome Version 35.0.1916.153)
2.Try to "launch Aladin"
3.Link "Launch Aladin" must change to aladin icon. (And client list does not refresh anymore)
Refresh page to remove glitch.
Second, "xhr.xhr.onabort" is that what I meant, cause samp.js
Creates an XHR facade - an object that presents an interface
resembling that of an XMLHttpRequest Level 2.
This facade may be based on an actual XMLHttpRequest Level 2 object
(on browsers that support it), or it may fake one using other
available technology.
So we must find onabort handler for all possible cases of this facade:
Based on XMLHttpRequest-type ( that what I wrote about )
Based on XDomainRequest
Based on Flash/flXHR
Also abort is not error, so we can't just say "xhr.onabort = xhr.onerror", this decision must make developer, based on his task.
@AnotherOneAckap , if xhr.xhr.onabort is what you meant, then from your fix it looks like the problem was the XMLHttpRequest Level 2 object lacking an onabort method, not as you said to start with the XmlRpcClient. That makes a bit more sense to me, is it what you meant?
If that's right, then adding an onabort method to the XMLHttpRequest object when the XHR facade is created would be cleaner than patching it up in the facade. Something like:
XDomainRequest has no documented onabort method so I think it can be ignored for this purpose, and the flXHR implementation is supposed to behave just like XMLHttpRequest (and uses the same code in samp.js) so should not need any special handling. I think this change would be harmless.
Activity
mbtaylor commentedon May 12, 2014
@AnotherOneAckap, I'm having trouble reproducing this - mostly the list updates correctly for me, though I think I did see the failure happen once. Unfortunately, I write javascript just infrequently enough that I forget it all between times, so I'm not totally on top of what's going on here.
There's at least a couple of things I don't understand. Can you explain in more detail what goes wrong as the result of the lack of an abort handler? I've written in the comments that abort is ignored, which I thought was reasonable, but if it's causing trouble clearly it needs a fix. Secondly, your suggested fix above says
xhr.xhr.onabort- is that what you mean, or should it just bexhr.onabort? It looks to me that something likexhr.onabort = xhr.onerrormight do the trick, but I still don't fully understand the problem.AnotherOneAckap commentedon Jun 21, 2014
@mbtaylor, You can see bug in action on http://ocl.sai.msu.ru/
1.Use menu in left top corner to connect to hub. (I used Google Chrome Version 35.0.1916.153)
2.Try to "launch Aladin"
3.Link "Launch Aladin" must change to aladin icon. (And client list does not refresh anymore)
Refresh page to remove glitch.
Second, "xhr.xhr.onabort" is that what I meant, cause samp.js
So we must find onabort handler for all possible cases of this facade:
Also abort is not error, so we can't just say "xhr.onabort = xhr.onerror", this decision must make developer, based on his task.
mbtaylor commentedon Jun 23, 2014
@AnotherOneAckap , if
xhr.xhr.onabortis what you meant, then from your fix it looks like the problem was the XMLHttpRequest Level 2 object lacking anonabortmethod, not as you said to start with the XmlRpcClient. That makes a bit more sense to me, is it what you meant?If that's right, then adding an
onabortmethod to the XMLHttpRequest object when the XHR facade is created would be cleaner than patching it up in the facade. Something like:XDomainRequest has no documented
onabortmethod so I think it can be ignored for this purpose, and the flXHR implementation is supposed to behave just like XMLHttpRequest (and uses the same code in samp.js) so should not need any special handling. I think this change would be harmless.Does it fix the problem for you?