Closed davidpanic closed 2 years ago
This looks like a protocol parsing error
What server are you using?
Sorry for the late response, I was away from work, we are using hasura version 2.9.0 running in a container. Specifically, it is hasura/graphql-engine:v2.9.0@sha256:ddfd9630ca8d1f6414b74983993b732e83cb76f1c44b89aa1f63b44670a9c61e
We're having the same error and the stacktrace we capture is pretty much the same as the one above.
graphql 5.1.2-beta.4 hasura v2.11.2-cloud.1
We're having the same error and the stacktrace we capture is pretty much the same as the one above.
Thanks, are you able to reproduce it with our API https://api.chat.graphql-flutter.dev/graphql
Chiming in with a very similar case.
` [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast
`
and with the error pointing to line websocket_messages.dart:L#56
final payload = (map['payload'] ?? <String, dynamic>{}) as Map<String, dynamic>;
My graphql version is 5.1.1 and using the Hasura cloud instance.
What I found is that the message causing the issue looks like that:
{"type":"connection_error","payload":"Could not verify JWT: JWTExpired"}
The payload
is String whereas GraphQLSocketMessage.parse
expects it to be Map:
final payload =
(map['payload'] ?? <String, dynamic>{}) as Map<String, dynamic>;
I think this PR https://github.com/zino-hofmann/graphql-flutter/pull/1242 is the fix but it required some more love
Describe the issue
To Reproduce
To be honest I have no idea how to reproduce this, it just kind of randomly happens. I was hoping you could help me figure it out. To me it seems like it might be an issue on your side.
device / execution context
Seen in release builds on android 10, 11 and 12, Flutter
Channel stable, 3.3.1
, dart2.18.0 (stable)
. I cannot reproduce it in debug mode.Other useful/optional fields
Stacktrace:
```dart #0 GraphQLSocketMessage.parse (package:graphql/src/links/websocket_link/websocket_messages.dart:61) #1 _MapStream._handleData (dart:async/stream_pipe.dart:213) #2 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153) #3 _rootRunUnary (dart:async/zone.dart:1399) #4 _CustomZone.runUnary (dart:async/zone.dart:1300) #5 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1209) #6 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339) #7 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271) #8 _SyncBroadcastStreamController._sendData.The client is initialized like this:
Sentry reports the following flutter_context: