-
Notifications
You must be signed in to change notification settings - Fork 93
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
TypeSafe graphql client websocket never closed #2086
Comments
|
@jmartisk Yes i have cancelled all subscriptions but i'm still receiving data from the server and the websocket seems to stay open after. Do you know a way to check for subscriptors programmaticallay? And i have this message after i cancel all subscription: "Received data for already canceled operation 1". This make me thing that my cancel work fine but the server or client is keeping the link opened |
By the way, my graphql client interface is split in more than one interface (for readability and maintenance) |
@jmartisk Can you confirm me that by default the client do not use the websocket to send query or mutation and there is no risk that the websocket is kept open to send the queries/mutations? |
Cancelling all subscriptions isn't enough, you have to close the client to close the websocket.
There is no straightforward way to programmatically get the list of active subscriptions on the server, but from the TRACE log on the server, it should be clear that the server stops the subscription and sends a confirmation to the client (that there will be no more messages for this particular subscription ID). Note that the client might log that message
Then each interface keeps its own websocket and you have to close all of them to close all the websockets
Right, by default, queries and mutations are executed over POST HTTP requests, unless you set |
My code is quite complex to produce a reproducible example. I think that maybe a subscription is still alive. I will merge all my graphql subscription into one graphql client and implement the closeable interface. Then i will check if i have the same behavior. |
@jmartisk Can i reuse a graphql client after calling close on it? If not how i can "reset" my graphql client after closing it? |
A closed client can't be resurrected. You'll need to use the If you use a configured client injected via CDI, it wasn't really designed to be closed at any point (and if the underlying websocket connection crashes, the client automatically attempts to recreate it) |
To my knowledge, there is no "simple" way to close the websocket used for the graphql client. I have a problem during a logout operation where I cancel all subscriptions but my application continues to receive notifications. "Received data for already canceled operation 1". This raises two problems for me:
The text was updated successfully, but these errors were encountered: