Skip to content

Undeliverable messages in StreamableServerTransport when there are no connected streams. #684

@jba

Description

@jba

For a brief period of time, a StreamableServerTransport has no streams. Notifications delivered during this gap fall on the floor.

Here is what happens when a client connects to a server using a streamable transport:

  1. Client sends an initialize request.
  2. Server creates a session.
  3. The request completes, ending the POST stream.
  4. Client sends a GET to create the standalone stream.

Between 3 and 4, the session exists (is on the Server.sessions slice) but has no streams. Sending messages to the session will fail.

Our tests have never observed this because they always create a server before clients connect, and the change notifications from AddTool and the like happen synchronously, when there are no sessions.

But when change notifications are delayed, as in #671, they may fall into the gap, causing an error to display (although processing is not otherwise affected).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions