-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix internet-up.ably-realtime.com checks #961
Conversation
The spec says: > In the case of an error necessitating use of an alternative host > (see RTN17d), the Connection manager should first check if an internet > connection is available [...] Changing fallback hosts is an instance of such an error, not just going from non-fallback to fallback. It also makes more sense.
Spec/RealtimeClientConnection.swift
Outdated
@@ -3560,16 +3560,19 @@ class RealtimeClientConnection: QuickSpec { | |||
TestProxyTransport.network = .hostUnreachable | |||
defer { TestProxyTransport.network = nil } | |||
|
|||
var urlConnections = [NSURL]() | |||
var urls = [NSURL]() |
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.
We can just use URL
instead of NSURL
and avoid those casts.
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.
Fixed at b13ddb5.
Spec/RealtimeClientConnection.swift
Outdated
if Optional(fallbackHost) == resultFallbackHosts.last { | ||
continue | ||
} | ||
// Host changed; should've had a internet check before. |
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.
Small typo: "should've had a internet"
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.
Fixed at 147d7b7.
} | ||
// wss://[a-e].ably-realtime.com: when a 401 occurs because of the `xxxx:xxxx` key | ||
client.connection.once(.failed) { error in | ||
done() |
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.
Does this need a partialDone
?
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.
The connection is going to get either to DISCONNECTED or to FAILED. Anyway, it was this way before.
CI is failing (sometimes):
|
@tcard Does the CI pass in your machine? |
It does, but this really is failing too much on CI. I'll come back to this at some point. |
CI failures seem unrelated to this fix and just seem related to the general theme of Travis just hanging for too long. |
@ricardopereira PTAL, GitHub dismissed your review after a merge commit. |
Run them on each fallback host change, and don't ignore the result.
Fixes #952.
Commit acdb52c supersedes #959 and fixes #931.