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

Miscellaneous tweaks to transport handling and auth tests #296

Closed
wants to merge 8 commits into from

Conversation

SimonWoolf
Copy link
Member

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.

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',
Copy link
Member

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?

Copy link
Member Author

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 :) )

@paddybyers
Copy link
Member

LGTM apart from a couple of comments.

SimonWoolf added a commit that referenced this pull request Jul 1, 2016
@SimonWoolf
Copy link
Member Author

Merged as 5e6b19a

@SimonWoolf SimonWoolf closed this Jul 1, 2016
@SimonWoolf SimonWoolf deleted the tweakymctweakface branch October 11, 2017 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants