Files
coder/coderd/database/migrations/000476_chat_pin_order_constraints.down.sql
T
Cian Johnston c602a31856 fix(coderd): reject pinning child chats in patchChat handler (#24669)
The UI already prevents child (delegated/subagent) chats from being
pinned, but the `PATCH /api/experimental/chats/{chat}` endpoint did not
enforce this. A direct API call could pin a child chat.

- Add a `400 Bad Request` guard in `patchChat` when `pinOrder > 0` and
the chat has a `ParentChatID`
- Add `TestChatPinOrder/RejectsChildChat` test

> 🤖
2026-04-23 18:36:20 +01:00

3 lines
150 B
SQL

ALTER TABLE chats DROP CONSTRAINT IF EXISTS chats_pin_order_parent_check;
ALTER TABLE chats DROP CONSTRAINT IF EXISTS chats_pin_order_archived_check;