Skip to content
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

message-bus-ajax.js fallback does not set statusText = "abort" for aborted requests #211

Open
alexandergitter opened this issue Jun 20, 2019 · 1 comment

Comments

@alexandergitter
Copy link

alexandergitter commented Jun 20, 2019

In its error function, the object passed to MessageBus.ajax checks to see if statusText === "abort". If it is, then a relatively low value gets used for the poll interval.

Compare https://github.com/SamSaffron/message_bus/blob/master/assets/message-bus.js#L267
and https://github.com/SamSaffron/message_bus/blob/master/assets/message-bus.js#L281

It looks like setting statusText to "abort" is something that jQuery does, not the browser. Which results in a potentially long delay between when a request is aborted (e.g. by subscribing to or unsubscribing from a channel) and when the subscriber receives new messages.

I think the message-bus-ajax.js fallback should somehow make sure to pass "abort" as the value for statusText or alternatively the error function could use a different way to determine whether or not the XHR has been aborted.

@SamSaffron
Copy link
Member

I am totally open to PR for a fix here, I think safest thing is to improve message-bus-ajax .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants