Closed
Description
The juniper_warp::subscriptions
module has been pretty neglected and has enough shortcomings to warrant a complete rewrite imo.
Things that should be improved in such a rewrite:
connection_init
handling should parse parameters sent from the client, and these should be exposed in a way that allows users of the library to perform authentication based on them. (Related: Add subscriptions connection_init behaviour #597)- The server should respond to
connection_init
with GQL_CONNECTION_ACK + GQL_CONNECTION_KEEP_ALIVE or GQL_CONNECTION_ERROR (e.g. if authentication failed). - It should be possible to execute queries and mutations over the connection, in addition to subscriptions.
- The server should send periodic keep-alives to the client (possibly with a configurable interval).
- Stopping a subscription should have more well-defined timing characteristics. For example, the values stream should be dropped immediately, and we shouldn't send the GQL_COMPLETE message until we can guarantee that no more events will be sent for that subscription.
- It should probably be possible for the bulk of the code to be framework-agnostic. I.e. the graphql-ws protocol implementation should be usable with frameworks other than Warp.
- The module needs extensive tests.
I think I'm pretty likely to attempt a rewrite if no one else beats me to it, but regardless of who does it, these are the things I would say need to be addressed.