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

IE11 Security Error on first client subscribe method. #528

Open
anon-eng opened this issue Nov 17, 2020 · 0 comments
Open

IE11 Security Error on first client subscribe method. #528

anon-eng opened this issue Nov 17, 2020 · 0 comments

Comments

@anon-eng
Copy link

I'm seeing intermittent SecurityError exceptions in IE11 (11.959.18362.3) on Windows10Pro.

When they occur, they seem to happen consistently for 10-20 refreshes, and then spontaneously they stop and are no reproducible at all.

Currently using Faye 1.2.4 but also saw the issue when I used the current (1.4.0)

Simple reproducible js code (when it happens):

faye = new Faye.Client(url, {timeout: myTimeout})
faye.on('transport:up', function() { console.log('transport went up')})

var sub = faye.subscribe(myChannel, function(msg) { console.log(msg)})

IE11 Throws a SecurityError in the subscribe call which I've tracked down to:

  • client::handshake
    ** this._dispatcher.selectTransport -> dispatcher::selectTransport

After I got that far and added some debugs, the issue spontaneously resolved and removing my debug would not reproduce again.

In an attempt to resolve this issue, I tried the following:

faye = new Faye.Client(url, {timeout: myTimeout})
faye.on('transport:up', function() { console.log('transport went up')})

try {
    var sub = faye.subscribe(myChannel, function(msg) { console.log(msg)})
} catch(err) {
   console.log('got the exception, trying a second time');
   var sub = faye.subscribe(myChannel, function(msg) { console.log(msg)})
}

When I run this code (when the issue is reproducible), I will get the console log for the SecurityException, but the second attempt will not raise any exception and it appears the sub object is valid, BUT I never get the console.log for the 'transport:up' event, so I'm unsure what state I'm actually in.

The only issue I can see (which maybe I'm reading it wrong) is that in src/protocol/client.js::handshake method, the selectTransport method is being invoked which appears to be an async operation, but instead of waiting for selectTransport to complete, the rest of handshake continues on. Is this a possible race condition, but for some reason only in IE11?

    this.info('Initiating handshake with ?', this._dispatcher.endpoint.href);
    this._dispatcher.selectTransport(constants.MANDATORY_CONNECTION_TYPES); // isn't this an async operation?

  // is this trying to send a message before the transport has completed being selected?
    this._sendMessage({
      channel:                  Channel.HANDSHAKE,
      version:                  constants.BAYEUX_VERSION,
      supportedConnectionTypes: this._dispatcher.getConnectionTypes()

    }, {}, function(response) {

      if (response.successful) {
        this._state = this.CONNECTED;
        this._dispatcher.clientId  = response.clientId;

        this._dispatcher.selectTransport(response.supportedConnectionTypes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant