Skip to content

Commit 6379be2

Browse files
authored
Merge pull request #189 from huang12zheng/master
fix #186 #188
2 parents 0bcb462 + 94e467b commit 6379be2

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

links/gql_websocket_link/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.1.7
2+
3+
- fix #188, Determine the boundary if `channelGenerator` is null and uri is not null
4+
- Update the dependent package rxdart to ^0.25.0
5+
16
## 0.1.6
27

38
- Delay requests until connect is done

links/gql_websocket_link/lib/src/link.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ class WebSocketLink extends Link {
9595
this.initialPayload,
9696
this.inactivityTimeout,
9797
}) : assert(uri == null || (channel == null && channelGenerator == null)) {
98-
_uri = uri;
99-
_channelGenerator = channelGenerator;
100-
_channel = channel ?? _channelGenerator();
98+
if (uri != null) {
99+
_uri = uri;
100+
} else {
101+
_channelGenerator = channelGenerator;
102+
_channel = channel ?? _channelGenerator();
103+
}
101104
_connectionStateController.value = closed;
102105
}
103106

links/gql_websocket_link/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: gql_websocket_link
2-
version: 0.1.6
2+
version: 0.1.7
33
description: GQL Websocket Link
44
repository: https://github.com/gql-dart/gql
55
environment:
@@ -9,7 +9,7 @@ dependencies:
99
gql_exec: ^0.2.5
1010
gql_link: ^0.3.1
1111
meta: ^1.1.8
12-
rxdart: ^0.24.0
12+
rxdart: ^0.25.0
1313
uuid_enhanced: ^3.0.2
1414
web_socket_channel: ^1.1.0
1515
dev_dependencies:

links/gql_websocket_link/test/gql_websocket_link_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ void main() {
1212
group(
1313
"WebSocketLink",
1414
() {
15+
test("WebSocketLink Construction with uri isn't null", () {
16+
final wsLink = WebSocketLink(
17+
"",
18+
initialPayload: {"authorization": "Bearer 12345"},
19+
);
20+
});
21+
1522
test(
1623
"send connection_init",
1724
() async {

0 commit comments

Comments
 (0)