twitch-cli
twitch-cli copied to clipboard
EventSub Subscriptions are a child of a single WebSocket server
What is the problem?
Subscriptions currently exist in the context of a single server, which is incorrect. They should be updated based on actions within the server, such as a client disconnecting, but should not be exclusively attached to it. See: https://github.com/twitchdev/twitch-cli/blob/main/internal/events/websocket/mock_server/server.go#L35
Instead, there should be 4 concepts in the mock WebSocket server:
- WebSocket Server (https://github.com/twitchdev/twitch-cli/blob/main/internal/events/websocket/mock_server/server.go)
- WebSocket Server Manager (https://github.com/twitchdev/twitch-cli/blob/main/internal/events/websocket/mock_server/manager.go)
- EventSub Manager (currently inside of server.go)
- Gateway, to handle HTTP entry (https://github.com/twitchdev/twitch-cli/blob/main/internal/events/websocket/mock_server/manager.go#L79)