You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found problems with both graphql-transport-ws and graphql-ws in webflux (reactive) mode. Using graphql-transport-ws it is not possible to subscribe more than once with different ids, while graphql-ws does not check for duplications and "forgets" previous subscriptions.
Expected behavior
It should be possible to subscribe multiple times using different ids. It should be also possible to stop subscriptions with those ids.
Actual behavior
graphql-transport-ws does not support multiple subscriptions:
You need any webflux subscription server and issue requests as above.
PS. I also found that error returned by the publisher in any subscription closes websocket. I think it should send error message to the client and terminate only one subscription, not whole session.
The text was updated successfully, but these errors were encountered:
I found problems with both
graphql-transport-ws
andgraphql-ws
in webflux (reactive) mode. Usinggraphql-transport-ws
it is not possible to subscribe more than once with different ids, whilegraphql-ws
does not check for duplications and "forgets" previous subscriptions.Expected behavior
It should be possible to subscribe multiple times using different ids. It should be also possible to stop subscriptions with those ids.
Actual behavior
graphql-transport-ws
does not support multiple subscriptions:Note that subscription id returned in error message (
6be19906
) is not what client supplied (1
). It looks like the implementation wrongly uses websocket session id instead of user supplied subscription id: https://github.com/Netflix/dgs-framework/blob/v5.4.3/graphql-dgs-spring-webflux-autoconfigure/src/main/kotlin/com/netflix/graphql/dgs/webflux/handlers/WebsocketGraphQLTransportWSProtocolHandler.kt#L93graphql-ws
takes whatever user throws at it:Now we can subscribe twice with the same id and we receive data from all subscriptions. We can stop the last subscription, but previous ones are forgotten and still emit data.
There is no id check around https://github.com/Netflix/dgs-framework/blob/v5.4.3/graphql-dgs-spring-webflux-autoconfigure/src/main/kotlin/com/netflix/graphql/dgs/webflux/handlers/WebsocketGraphQLTransportWSProtocolHandler.kt#L109
Steps to reproduce
You need any webflux subscription server and issue requests as above.
PS. I also found that error returned by the publisher in any subscription closes websocket. I think it should send error message to the client and terminate only one subscription, not whole session.
The text was updated successfully, but these errors were encountered: