zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.23k stars 608 forks source link

set initial value for BehaviorSubject<SocketConnectionState>, update connectivity_plus #1433

Closed hantrungkien closed 1 month ago

hantrungkien commented 1 month ago

When use toggleConnection will throw at

[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.
#0      BehaviorSubject.value (package:rxdart/src/subjects/behavior_subject.dart:146:5)
#1      SocketClient._listenToToggleConnection.<anonymous closure> (package:graphql/src/links/websocket_link/websocket_client.dart:264:40)
#2      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#3      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#4      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#5      _MultiStreamController.addSync (dart:async/stream_impl.dart:1101:36)
#6      _MultiControllerSink.add (package:rxdart/src/utils/forwarding_stream.dart:130:35)
#7      _TakeUntilStreamSink.onData (package:rxdart/src/transformers/take_until.dart:13:31)
vincenzopalazzo commented 1 month ago

the crash that you are reporting is something that it is caused by connectivity_plus?

This is unclear to me, sorry!

In addition, can you add the stacktrace in the commit body as out dev guide explain?

hantrungkien commented 1 month ago

@vincenzopalazzo I'm so sorry for confusing you. My PR includes two changes:

  1. Upgrate: connectivity_plus: ^6.0.3 for graphql_flutter package.
  2. Resolve: error log is throwed from graphql package althought it doesn't make any crash.

I think it's simple PR so want to merge into one commit.

Thanks for answering!

vincenzopalazzo commented 1 month ago

Can you add them inside the commit body message?

You should be able to edit it with git commit --amend

hantrungkien commented 1 month ago

@vincenzopalazzo I've updated. Please review it for me.

Thank you very much!

vincenzopalazzo commented 1 month ago

It is missing the stacktrace inside the commit body as suggested before

hantrungkien commented 1 month ago

@vincenzopalazzo please review help me again. Many thanks!

vincenzopalazzo commented 1 month ago

Thanks @hantrungkien now the last thing is dropping the commit that we do not need

https://stackoverflow.com/a/1338758/10854225

You should drop the following commits: