From cd6c507cb6d2fa77b5b233285898be5362ce4898 Mon Sep 17 00:00:00 2001 From: kienhantrung Date: Mon, 27 May 2024 18:36:38 +0700 Subject: [PATCH 1/2] fix(graphql_flutter): upgrade connectivity_plus 2 important commits: v6.0.2: https://github.com/fluttercommunity/plus_plugins/pull/2763 v6.0.3: https://github.com/fluttercommunity/plus_plugins/pull/2836 --- packages/graphql_flutter/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphql_flutter/pubspec.yaml b/packages/graphql_flutter/pubspec.yaml index 30185336..0c9c0e2a 100644 --- a/packages/graphql_flutter/pubspec.yaml +++ b/packages/graphql_flutter/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: meta: ^1.7.0 path_provider: ^2.0.1 path: ^1.8.0 - connectivity_plus: ^6.0.1 + connectivity_plus: ^6.0.3 hive: ^2.0.0 plugin_platform_interface: ^2.0.0 flutter_hooks: '>=0.18.2 <0.21.0' From def3290c485856b5477a7fc3d6334adcbf489285 Mon Sep 17 00:00:00 2001 From: kienhantrung Date: Mon, 27 May 2024 18:39:47 +0700 Subject: [PATCH 2/2] fix(graphql): fix error is throwed when toggleConnection != null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [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. (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) --- .../graphql/lib/src/links/websocket_link/websocket_client.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/graphql/lib/src/links/websocket_link/websocket_client.dart b/packages/graphql/lib/src/links/websocket_link/websocket_client.dart index 9f6ff470..ecca76c8 100644 --- a/packages/graphql/lib/src/links/websocket_link/websocket_client.dart +++ b/packages/graphql/lib/src/links/websocket_link/websocket_client.dart @@ -215,7 +215,8 @@ class SocketClient { final SocketClientConfig config; final BehaviorSubject _connectionStateController = - BehaviorSubject(); + BehaviorSubject.seeded( + SocketConnectionState.notConnected); final HashMap _subscriptionInitializers = HashMap();