From 8776f4baf7831a5fd86c4492e7e434d60fd2cf61 Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Fri, 4 Sep 2026 09:55:15 +0200 Subject: [PATCH] fix(coderd/x/chatd): avoid closing poller hint channels (#28746) Closes SEC-515 Prevent a `send on closed channel` panic when a chat stream unregisters during polling. The poller no longer owns or closes subscriber channels. This is safe because delivery is guarded by the stream context, and unregister removes the subscriber from future polls. (cherry picked from commit ced03dc30baecc9a08cef57996374dc358fcb824) --- coderd/x/chatd/stream_sync_poller.go | 1 - 1 file changed, 1 deletion(-) diff --git a/coderd/x/chatd/stream_sync_poller.go b/coderd/x/chatd/stream_sync_poller.go index 11e9171687e64..2a87a9af12166 100644 --- a/coderd/x/chatd/stream_sync_poller.go +++ b/coderd/x/chatd/stream_sync_poller.go @@ -101,7 +101,6 @@ func (p *streamSyncPoller) unregister(subscriber *streamSyncPollerSubscriber) { if len(chatSubscribers) == 0 { delete(p.subscribers, subscriber.chatID) } - close(subscriber.hints) } func (p *streamSyncPoller) loop() {