Skip to content

Commit 77f3386

Browse files
author
Klever
committed
Upgrade connectivity_plus & Resolve error log
1. Upgrate: connectivity_plus: ^6.0.3 for graphql_flutter package. 2. Resolve: error is throwed from graphql package (althought it doesn't make any crash) when toggleConnection != null. [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ValueStream has no value. You should check ValueStream.hasValue before accessing ValueStream.value, or use ValueStream.valueOrNull instead. BehaviorSubject.value (package:rxdart/src/subjects/behavior_subject.dart:146:5) SocketClient._listenToToggleConnection.<anonymous closure> (package:graphql/src/links/websocket_link/websocket_client.dart:264:40) _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10) _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11) _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7) _MultiStreamController.addSync (dart:async/stream_impl.dart:1101:36) _MultiControllerSink.add (package:rxdart/src/utils/forwarding_stream.dart:130:35) _TakeUntilStreamSink.onData (package:rxdart/src/transformers/take_until.dart:13:31)
1 parent c0621cc commit 77f3386

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/graphql/lib/src/links/websocket_link/websocket_client.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ class SocketClient {
215215
final SocketClientConfig config;
216216

217217
final BehaviorSubject<SocketConnectionState> _connectionStateController =
218-
BehaviorSubject<SocketConnectionState>();
218+
BehaviorSubject<SocketConnectionState>.seeded(
219+
SocketConnectionState.notConnected);
219220

220221
final HashMap<String, SubscriptionListener> _subscriptionInitializers =
221222
HashMap();

packages/graphql_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
meta: ^1.7.0
1616
path_provider: ^2.0.1
1717
path: ^1.8.0
18-
connectivity_plus: ^6.0.1
18+
connectivity_plus: ^6.0.3
1919
hive: ^2.0.0
2020
plugin_platform_interface: ^2.0.0
2121
flutter_hooks: '>=0.18.2 <0.21.0'

0 commit comments

Comments
 (0)