Skip to content

[BUG] Two tables with connected clients #170

@alex35mil

Description

@alex35mil

I'm not sure if it's a bug or if I just don't understand the implementation, but the current ws server has two tables with connected clients:

  1. ---@field clients table A list of connected clients
  2. ---@field clients table Table of connected clients (client_id -> WebSocketClient)

It seems like they store the same thing, but they are pretty much out of sync most of the time.

What I see:

  • when I open CC terminal, both receive a new client connection (identical)
  • when I hit Ctrl-C in CC terminal (exit session), its client connection is removed from both tables, but immediately after, a new connection appears in server/init, but not in server/tcp. server/init constantly grows with these phantom connections that appear after each terminated session. I can't figure out what initiates this connection and why it stays in the server/init clients table.

Is this by design? What initiates this second connection after the session termination?

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