Skip to content

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

@alexandergitter

Description

@alexandergitter

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.

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