-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gql_websocket_link] Crash events on host lookup #423
Comments
I just realized that, around the same time, I switched on fatal and async error recording for Firebase Crashlytics (which may explain why I did not see this happen with
I assume it is the async error recording that is the culprit here. Still, is there a way to catch it? |
In the meantime I found this: dart-lang/web_socket_channel#38. I am going to test whether the suggested solution of awaiting socket.ready will allow me to catch the error in the channelGenerator callback. |
Preliminary testing seems to indicate this fixes it for initial connection errors:
Shouldn't the default channelGenerator be robust against this to? Additionally, returning the errored socket, also results in an uncaught async error later on in its usage. |
I switched to gql_websocket_link to connect to my GraphQL backend (before I used
hasura_connect
). Since this switch, Firebase Crashlytics reports:I think this is due to the connection being interrupted by me switching off mobile and wifi connectivity. So, obviously, the actual error makes sense. However, I don't think the app should crash nor be reported on Crashlytics when I do.
Currently, the connection is implemented as:
I thought switching to the channelGenerator argument (with a
null
url), I would be able to wrap the WebSocketChannelException in a try/catch clause to avoid this. However, somehow, the SocketException keeps on escaping my try/catch and hence keeps on crashing the app:My
main/AndroidManifest.xml
contains theandroid.permission.INTERNET
permission:Even though I really doubt I am the first one to see this issue, I do not find any related issues. Can you point me to an example or the typical solution to fix this?
The text was updated successfully, but these errors were encountered: