Skip to content

Keep alive messages are stopped onComplete #196

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

Closed
ArturKT opened this issue Jul 2, 2019 · 0 comments
Closed

Keep alive messages are stopped onComplete #196

ArturKT opened this issue Jul 2, 2019 · 0 comments
Labels
Milestone

Comments

@ArturKT
Copy link

ArturKT commented Jul 2, 2019

Consider the following scenario:

  1. Client opens new WebSocket connection with Graphl server and sends GQL_CONNECTION_INIT
  2. Server in response sends GQL_CONNECTION_ACK and GQL_CONNECTION_KEEP_ALIVE
  3. The client sends 1st subscription query
  4. The client sends a 2nd subscription query
  5. Some time passes, the client receives GQL_CONNECTION_KEEP_ALIVE messages every 15 seconds
  6. 2nd subscription query is completed. On completed server aborts sending GQL_CONNECTION_KEEP_ALIVE messages even though 1st subscription query is still not completed.

In such a scenario the client will disconnect from the server because of missing GQL_CONNECTION_KEEP_ALIVE messages. The conclusion is - server should not stop sending keep-alive messages when subscription completes. It should happen when the WebSocket connection is closed.

Take a look at the specification of GQL_COMPLETE and GQL_KEEP_ALIVE. It says nothing about stopping sending GQL_KEEP_ALIFE after sending GQL_COMPLTE:

GQL_COMPLETE

Server sends this message to indicate that a GraphQL operation is done, and no more data will arrive for the specific operation.

id: string : operation ID of the operation that completed

GQL_CONNECTION_KEEP_ALIVE

Server message that should be sent right after each GQL_CONNECTION_ACK processed and then periodically to keep the client connection alive.

The client starts to consider the keep alive message only upon the first received keep alive message from the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants