fix(coderd): fix memory leak in watchWorkspaceAgentMetadata (#10685)

Fixes #10550
This commit is contained in:
Mathias Fredriksson
2023-11-16 17:03:53 +02:00
committed by GitHub
parent c130f8d6d0
commit 198b56c137
4 changed files with 269 additions and 43 deletions
+5
View File
@@ -492,6 +492,11 @@ func (c *Client) WatchWorkspaceAgentMetadata(ctx context.Context, id uuid.UUID)
firstEvent = false
}
// Ignore pings.
if sse.Type == ServerSentEventTypePing {
continue
}
b, ok := sse.Data.([]byte)
if !ok {
return xerrors.Errorf("unexpected data type: %T", sse.Data)