twitchdev / twitch-cli

The official Twitch CLI to make developing on Twitch easier.
Apache License 2.0
604 stars 71 forks source link

[Bug] mock event websocket server ignores a valid 'session' #331

Closed otrocodigo closed 2 months ago

otrocodigo commented 2 months ago

What is the problem?

When sending an event from 'twich-cli' to the websocket specifying a valid session, it does not filter the clients and sends the message to all of them.

twitch-cli/1.1.24

Operating System

Debian GNU/Linux 12 (bookworm)

Architecture Version (x86, x64, arm, etc)

x64

Steps to reproduce

  1. Starting the websocket server twitch event websocket start-server
  2. I connect to the websocket from a client (abcd1234), and it captures the connection event Client connected [abcd1234]
  3. I connect to the websocket from another client (efgh5678), and it captures the connection event: Client connected [efgh5678]

[<server>] Connections: (2) [ abcd1234, efgh5678 ]

  1. I send an event specifying an invalid session, and it informs me that it is not valid. ✅ twitch event trigger channel.ban --transport=websocket --session=<server>_a1b2c3d4
Error executing remote triggered EventSub: Client [a1b2c3d4] does not exist on server [<server>]
  1. Send an event specifying a valid session and send the messages to all clients. 🚫 twitch event trigger channel.ban --transport=websocket --session=<server>_abcd1234
Sent [channel.ban / 1] to client [abcd1234]
Sent [channel.ban / 1] to client [efgh5678]

The message should only be sent to the specified client (abcd1234)

Relevant log output

No response