Skip to content

Keep alive messages are stopped onComplete #196

Closed
@ArturKT

Description

@ArturKT

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions