Skip to content

Client tracker does not process aboting his 'pullCallbacks' requests #5

@AnotherOneAckap

Description

@AnotherOneAckap

Steps to reproduce:
1.Open http://astrojs.github.io/sampjs/examples/monitor.html and connect it to hub
2.Add to page HTML with devtools or script this link

<a href="javascript:void(document.location='http://aladin.u-strasbg.fr/java/nph-aladin.pl?frame=get&id=AladinBeta.jnlp');">launch Aladin</a>

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

diff --git a/samp.js b/samp.js
index a621029..33b0aa9 100644
--- a/samp.js
+++ b/samp.js
@@ -591,6 +591,9 @@ var samp = (function() {
                     errHandler(event);
                 }
             };
+            xhr.xhr.onabort = function(event) {
+              xhr.onerror(event);
+            };
             xhr.send(req.toXml());
             return xhr;
         })(this);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions