enisdenjo / graphql-ws

Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
https://the-guild.dev/graphql/ws
MIT License
1.75k stars 162 forks source link

fix(ws): wait for subscriptions to finish when closing server #473

Closed ttoohey closed 1 year ago

ttoohey commented 1 year ago

The dispose() method would resolve before a subscription that has cleanup tasks in a return() method has completed. This change allows those subscriptions to complete so that awaiting dispose() will ensure that all subscription cleanup tasks have completed

ttoohey commented 1 year ago

closing as https://github.com/enisdenjo/graphql-ws/pull/474 should allow for cleanup to be performed without having side effects in .return()