Latest firefox not firing clean disconnect on browser refresh #2357

Closed
davidfowl opened this Issue Jul 29, 2013 · 4 comments

Comments

Projects
None yet
4 participants
Owner

davidfowl commented Jul 29, 2013

The server is self hosted and the connection is cross domain using long polling (not jsonp).

Owner

DamianEdwards commented Jul 29, 2013

This repros without self-host or cross domain.

Owner

DamianEdwards commented Jul 29, 2013

Seems Firefox prevents synchronous ajax from window.unload: http://forums.mozillazine.org/viewtopic.php?f=25&p=12964775

I've confirmed that changing to async ajax on window.unload makes Firefox work, but it breaks Chrome 😢

We may have to browser sniff and conditionally fire the abort Ajax request as sync/async depending on the browser.

@DamianEdwards DamianEdwards added a commit that referenced this issue Jul 30, 2013

@DamianEdwards DamianEdwards Fix Firefox not disconnecting on refresh
- Change the withCredentials flag to only be auto-set when cross-domain is detected (can still be explicitly set)
- Conditionally do an async abort if the browser is Firefox 11+ AND withCredentials is true
- #2357
b38db89

@DamianEdwards DamianEdwards added a commit that referenced this issue Jul 30, 2013

@DamianEdwards DamianEdwards Added unit tests for Firefox disconnect on refresh
- Crated a new QUnit extension to enable theories (data-driven tests)
- Other minor JS test project fixes/shuffling
- #2357
82b8519

DamianEdwards referenced this issue Jul 30, 2013

Closed

2357 #2365

@DamianEdwards DamianEdwards added a commit that referenced this issue Jul 30, 2013

@DamianEdwards @DamianEdwards DamianEdwards + DamianEdwards Fix Firefox not disconnecting on refresh
- Change the withCredentials flag to only be auto-set when cross-domain is detected (can still be explicitly set)
- Conditionally do an async abort if the browser is Firefox 11+ AND withCredentials is true
- #2357
458589c

@DamianEdwards DamianEdwards added a commit that referenced this issue Jul 30, 2013

@DamianEdwards @DamianEdwards DamianEdwards + DamianEdwards Added unit tests for Firefox disconnect on refresh
- Crated a new QUnit extension to enable theories (data-driven tests)
- Other minor JS test project fixes/shuffling
- #2357
1f4568f
Contributor

gustavo-armenta commented Jul 31, 2013

tested on IE setting on debugger connection.withCredentials = true and connection.stop() is sync.
tested on Firefox11 setting on debugger connection.withCredentials = true and connection.transport.abort(connection, async) is called with async = true

@DamianEdwards @gustavo-armenta In the 458589c commit i can see a line

  var asyncAbort = !!connection.withCredentials && firefoxMajorVersion(window.navigator.userAgent) >= 11;

Where does the value "connection.withCredentials" is coming from? For me it is always undefined and so my asyncAbort is always false. This makes my long running abort call blocking everything in chrome and IE. Note: I am not using any cross domain calls.

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