Skip to content
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

ws: Unhandled exceptions from SocketClient #1270

Open
etegan opened this issue Dec 7, 2022 · 1 comment
Open

ws: Unhandled exceptions from SocketClient #1270

etegan opened this issue Dec 7, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request Priority: High High priority to include it inside next release ⚡ websocket Web Socket Related
Projects
Milestone

Comments

@etegan
Copy link

etegan commented Dec 7, 2022

Describe the issue
The SocketClient._connect() function sets up a bunch of StreamSubscriptions on _messages that don't have any onError callbacks. For example #1228 will result in multiple unhandled exceptions that can't be caught by the user of this package.

To Reproduce

  1. Make GraphQLSocketMessage.parse throw any exception
  2. Try to catch it from any application that tries to create a ws connection
  3. observe the mayhem
  4. (optional) Change Stream<GraphQLSocketMessage> get _messages => socketChannel!.messages; in SocketClient
    to Stream<GraphQLSocketMessage> get _messages => socketChannel!.messages.handleError((e) => print("Getting errors ${e}"))

Expected behavior
Exceptions from SocketClient should not escape _connect() or the user should be able to catch them.

@vincenzopalazzo vincenzopalazzo added the ⚡ websocket Web Socket Related label Dec 7, 2022
@vincenzopalazzo vincenzopalazzo self-assigned this Dec 7, 2022
@vincenzopalazzo vincenzopalazzo added this to To do in v5.2.0 via automation Dec 7, 2022
@vincenzopalazzo
Copy link
Collaborator

You are right, there is some work to do to modify the error handling!

Thanks to report it

@vincenzopalazzo vincenzopalazzo added this to the v5.2.0 milestone Dec 7, 2022
@vincenzopalazzo vincenzopalazzo added enhancement New feature or request Priority: High High priority to include it inside next release labels Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Priority: High High priority to include it inside next release ⚡ websocket Web Socket Related
Projects
v5.2.0
To do
Development

No branches or pull requests

2 participants