Describe the bug
thread 'tokio-runtime-worker' panicked at 'Websocket receive error: WebSocket protocol error: Connection reset without closing handshake', ....cargogitcheckoutsjuniper-aa5e857cd28538c7cab6decjuniper_warpsrclib.rs:495:46
To Reproduce
Not sure. But I guess reset a connection when sending websocket frame could reproduce.
Expected behavior
Don't panic because one connection is reset.
Additional context
@nWacky
@spacemeowx2,
I looked it up.
For now it's unclear how to handle errors when dealing with channels. For now, it creates a new channel which returns all messages to end user and keeps executing logic inside ForEach future. Because ForEach expects return type of Future<Output = ()>, it's not possible to return errors in there => it's not possible to return errors for now (a potential workaround could be by implemeting custom future that drives iterator to completion).
For now, I can change juniper_warp's subscriptions impl so that it ignores errors. Over the longer term, it would be better to add full support for subscriptions over ws protocol and return an error if connection reset without closing handshake or something else happens
Would an optional dependency using https://github.com/tokio-rs/async-stream help?
What about using fold instead of for_each?
fold worked, didn't think of it.