From 6c7898f46dac924e966ce839d8b458170f93aa8c 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 11e9171687e..2a87a9af121 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() {