feat(api): rename + delete conversation endpoints (#364) #366
No reviewers
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol!366
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "364-chat-conversation-mgmt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The data layer for chat conversation management (#364). The switcher needs to rename and delete conversations, but only GET existed. This adds the endpoints + hooks; the chat switcher UI is a follow-up — deliberately sequenced after the in-flight
chat.tsxchanges (#352 markdown, #363 diffs) settle, to avoid a three-way merge pileup on that file.What's in it
ConversationsRepository.updateTitle(id, title)anddelete(id).deleteclears messages then the conversation as two plain statements — FK enforcement isn't on for the SQLite leg, and a transaction would run against libsql's per-connection:memory:test DB (schemaless); messages-first self-heals on a mid-failure.PATCH /api/conversations/{id}(rename,zUpdateConversationRequest; empty title clears it) andDELETE /api/conversations/{id}(200 { ok }). Per-user 404; a cross-user rename/delete can't touch another user's conversation.@carol/api-client:useUpdateConversation+useDeleteConversation.Verification (local)
typecheck✓ ·lint✓testagainst both engines (ephemeral Postgres): 1238 passed, 0 skipped (+ dual-engine repo tests: rename, delete-cascades-messages; route tests: rename/clear, delete→404, cross-user 404, 401)@carol/api-client:check✓ · test ✓ 42 ·openapi:check✓ · coverage 121Follow-up (the rest of #364)
chat.tsxonce #352/#363 merge.Part of #364.
🤖 Generated with Claude Code
The chat conversation switcher needs to rename and delete conversations; only GET existed. Add the data layer + hooks (the chat UI is a follow-up, sequenced after the in-flight chat.tsx changes settle). - ConversationsRepository.updateTitle(id, title) and delete(id). delete clears messages then the conversation as two plain statements — FK enforcement isn't on for the SQLite leg, and a transaction would run against libsql's per-connection :memory: DB; messages-first self-heals. - PATCH /api/conversations/{id} (rename, zUpdateConversationRequest) and DELETE /api/conversations/{id} (200 {ok}). Per-user 404; cross-user rename/delete can't touch another user's conversation. - @carol/api-client: useUpdateConversation + useDeleteConversation. - zod/openapi + api-client types regenerated (coverage 119 → 121). Dual-engine repo tests (rename, delete-cascades-messages) + route tests (rename/clear, delete→404, cross-user 404, 401). Part of #364. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>📊 Test coverage
Patch coverage: no testable lines changed.
Overall (
app/,lib/,db/, excluding UI per ADR-0019):Soft thresholds per ADR-0019. Coverage is informational and does not block merge.