Skip to content

feat: migrate trailing deletes to /api/chats/{id}/messages/trailing#385

Open
arpitgupta1214 wants to merge 2 commits intotestfrom
codex/arpit-migrate-memories-delete-trailing-api
Open

feat: migrate trailing deletes to /api/chats/{id}/messages/trailing#385
arpitgupta1214 wants to merge 2 commits intotestfrom
codex/arpit-migrate-memories-delete-trailing-api

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

Summary

  • add dedicated DELETE /api/chats/{id}/messages/trailing endpoint
  • validate chat access and from_message_id ownership
  • add trailing delete handler/query tests and supabase helpers

Notes

  • branch is squashed to one commit

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Mar 31, 2026 8:24pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@arpitgupta1214 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 9 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 9 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 149a2277-0732-456c-bbfc-79e4fd10587c

📥 Commits

Reviewing files that changed from the base of the PR and between 4afc4cf and f42f767.

⛔ Files ignored due to path filters (2)
  • lib/chats/__tests__/deleteTrailingChatMessagesHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/chats/__tests__/validateDeleteTrailingMessagesQuery.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (5)
  • app/api/chats/[id]/messages/trailing/route.ts
  • lib/chats/deleteTrailingChatMessagesHandler.ts
  • lib/chats/validateDeleteTrailingMessagesQuery.ts
  • lib/supabase/memories/deleteMemoriesByRoomIdAfterTimestamp.ts
  • lib/supabase/memories/selectMemoryById.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/arpit-migrate-memories-delete-trailing-api

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arpitgupta1214
Copy link
Copy Markdown
Collaborator Author

Quick smoke test run against this PR preview deployment.

Preview URL: https://recoup-api-git-codex-arpit-migrate-m-29f770-recoupable-ad724970.vercel.app
Auth: Authorization Bearer token

Results:

  • POST /api/chats with {} -> 200, chat created (f88a9e3c-f4fc-4135-852a-bf4362ca8baa)
  • DELETE /api/chats/f88a9e3c-f4fc-4135-852a-bf4362ca8baa/messages/trailing?from_message_id=1d5ed162-544b-45b9-a57f-785be036d445 -> 404, { "status": "error", "error": "Message not found" }
  • DELETE /api/chats/f88a9e3c-f4fc-4135-852a-bf4362ca8baa/messages/trailing (missing query param) -> 400, includes from_message_id validation error

Smoke verdict: trailing-delete endpoint is reachable, authenticated, and validation/error paths behave as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant