-
Notifications
You must be signed in to change notification settings - Fork 55
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
Miscellaneous tweaks to transport handling and auth tests #296
Conversation
The original idea behind not stopping it was in case something stalled the websocket between 'viable' and 'connected' stages, so that the fallback would be used then. In practice we have no evidence that that's ever happened (an established websocket generally means we can use the websocket transport), and keeping the timeout running causes problems if the connection is successful but then something else disconnects it just before the timeout expires (eg a quick token expiry).
Previously, only every other transport in eg the pendingTransports array was getting disconnected by disconnectAllTransports, as each disconnection (in deactivateTransport) was mutating pendingTransports to remove itself. This would be ok if the removal used `delete`, but it (meaning Utils.arrDeleteValue) used slice, which renumbers as it goes, so array iteration gets messed up.
So it doesn't fail if the token takes too long to get, and/or take ages to give it enough buffer not to do the other thing
Why? Because you can't abort requests. (You can remove the node, but that doesn't cancel the request). So recv requests stick around for 90s till realtime ends them. So in a test, the browsers max-connections-per-host limit fills up quickly, which messes up other comet transports too
While sandbox is unstable, to avoid spurious failures
@@ -3,7 +3,7 @@ | |||
define(function(require) { | |||
var defaultLogLevel = 2, | |||
environment = isBrowser ? (window.__env__ || {}) : process.env, | |||
ablyEnvironment = environment.ABLY_ENV || 'sandbox', | |||
ablyEnvironment = environment.ABLY_ENV || 'staging', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to commit this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, was just to change the ci run. (Hence the commit message of TEMP NOTFORMERGING
:) )
LGTM apart from a couple of comments. |
Merged as 5e6b19a |
Fix a couple bugs in transport handling (fricking mutable arrays), and a few causes of ably-js test instability. (Though mostly still not passing ci due to https://github.com/ably/infrastructure/issues/711 etc).
Also temporarily running against staging in ci, as sandbox is currently buggered.