mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: resolve bugs in pubsub and codersdk chat packages (#22717)
This commit is contained in:
@@ -23,7 +23,7 @@ func HandleChatEvent(cb func(ctx context.Context, payload ChatEvent, err error))
|
||||
}
|
||||
var payload ChatEvent
|
||||
if err := json.Unmarshal(message, &payload); err != nil {
|
||||
cb(ctx, ChatEvent{}, xerrors.Errorf("unmarshal chat event"))
|
||||
cb(ctx, ChatEvent{}, xerrors.Errorf("unmarshal chat event: %w", err))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -802,7 +802,7 @@ func (c *Client) StreamChat(ctx context.Context, chatID uuid.UUID, opts *StreamC
|
||||
|
||||
return events, closeFunc(func() error {
|
||||
streamCancel()
|
||||
return conn.Close(websocket.StatusNormalClosure, "")
|
||||
return nil
|
||||
}), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user