-
Notifications
You must be signed in to change notification settings - Fork 0
feat(llc)!: bound and authenticate a connection attempt #160
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
Changes from all commits
1abd7d4
15e5016
64c7af7
705123f
ba79c6a
bc46b99
39952e5
32c5a40
b0f94d1
47b346d
e321b8e
e3d700b
7c772d5
68cedda
d88bb57
c613345
b3454b7
300908c
0737726
2ad554c
f4a8f73
72b1447
1949cbc
0a6d8e6
e4ac1b4
dd48bce
0e4b96a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ class WebSocketOptions { | |
| /// Creates a new instance of [WebSocketOptions]. | ||
| const WebSocketOptions({ | ||
| required this.url, | ||
| this.connectTimeout, | ||
| this.connectTimeout = defaultConnectTimeout, | ||
| this.protocols, | ||
| this.queryParameters, | ||
| }); | ||
|
|
@@ -35,9 +35,17 @@ class WebSocketOptions { | |
|
|
||
| /// Maximum time allowed for establishing the WebSocket connection. | ||
| /// | ||
| /// When specified, the connection attempt will timeout if not completed | ||
| /// within this duration. If `null`, uses the platform default timeout. | ||
| final Duration? connectTimeout; | ||
| /// Covers the whole attempt, not just opening the socket: a connection that | ||
| /// opens but is never established is abandoned once this elapses. | ||
| /// | ||
| /// Defaults to [defaultConnectTimeout]. | ||
| final Duration connectTimeout; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that the old Worth calling out in the changelog as a behaviour change though, not just an API one: every existing connection now gets abandoned after 15s if the first health check hasn't arrived, where before it waited indefinitely. Paired with |
||
|
|
||
| /// The [connectTimeout] used when none is given. | ||
| /// | ||
| /// Matches the wait the Swift SDK allows for the same handshake; the Android | ||
| /// one is stricter at ten seconds. | ||
| static const defaultConnectTimeout = Duration(seconds: 30); | ||
|
|
||
| /// WebSocket sub-protocols to negotiate during the handshake. | ||
| /// | ||
|
|
||
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.
Nit: no doc comment on new public API. The class has none either so it's consistent as-is — but the two decisions worth writing down are the ones a caller can't infer:
role/teamsomitted because the server assigns them, andnamecoming fromoriginalNameso a user with no name doesn't get their id sent as one. That last part is a good catch; every product was getting it wrong by hand.