Merge pull request #1620 from recoupable/codex/arpit-migrate-memories…#1630
Conversation
…-delete-trailing-chat feat: migrate trailing message deletes to dedicated endpoint
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR refactors trailing message deletion from a Supabase-direct pattern to an HTTP-based approach using chat-specific endpoints. The old single memory ID route is removed, replaced with a new Changes
Sequence DiagramsequenceDiagram
participant MessageEditor as MessageEditor
participant Hook as useDeleteTrailingMessages
participant Query as TanStack Query
participant Auth as Privy
participant API as HTTP API
MessageEditor->>Hook: deleteTrailingMessages({chatId, fromMessageId})
Hook->>Query: mutateAsync() triggered
Query->>Auth: getAccessToken()
Auth-->>Query: accessToken
Query->>API: DELETE /api/chats/{chatId}/trailing-messages?fromMessageId={id}<br/>(with Bearer token)
API-->>Query: Success / Error response
Query-->>Hook: Returns promise
Hook-->>MessageEditor: Mutation complete, isDeletingTrailingMessages state updated
MessageEditor->>MessageEditor: Update message state with edited content,<br/>switch to view mode, conditionally reload
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…-delete-trailing-chat
feat: migrate trailing message deletes to dedicated endpoint
Summary by CodeRabbit
Refactor
Chores