chore: Add OpenAPI support to chat.delete and chat.react endpoints#39220
chore: Add OpenAPI support to chat.delete and chat.react endpoints#39220sezallagwal wants to merge 3 commits intoRocketChat:developfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 9547f23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (11)📓 Common learnings📚 Learning: 2026-02-24T19:09:09.561ZApplied to files:
📚 Learning: 2026-02-25T20:10:16.987ZApplied to files:
📚 Learning: 2026-02-23T17:53:18.785ZApplied to files:
📚 Learning: 2025-09-16T13:33:49.237ZApplied to files:
📚 Learning: 2026-02-24T19:36:55.089ZApplied to files:
📚 Learning: 2026-01-17T01:51:47.764ZApplied to files:
📚 Learning: 2025-12-10T21:00:54.909ZApplied to files:
📚 Learning: 2025-09-16T13:33:49.237ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
🔇 Additional comments (1)
WalkthroughMigrates global Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(240,240,255,0.5)
participant Client
participant API as API.v1.chat
participant Validator
participant Auth as PermissionCheck
participant DB as MessagesDB
end
Client->>API: POST /v1/chat.delete { msgId, roomId, ... }
API->>Validator: validate request (AJV)
Validator-->>API: validated params
API->>Auth: check permissions (user, room)
Auth-->>API: allowed/denied
API->>DB: fetch message by msgId
DB-->>API: message
API->>DB: perform delete/react operation
DB-->>API: result
API-->>Client: 200 { _id, ts, message: {...} } or 403/404
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/rest-typings/src/v1/chat.ts">
<violation number="1" location="packages/rest-typings/src/v1/chat.ts:1005">
P2: `/v1/chat.delete` was removed from `ChatEndpoints`, but the endpoint is still used in app code and `Endpoints` still depends on `ChatEndpoints`, so type coverage for this REST route is dropped.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
Fixed in the latest commit — retained /v1/chat.delete in ChatEndpoints for client-side type coverage. @cubic-dev-ai |
|
Thanks for providing the screenshots! also Once you solve these issues, this PR will be ready |
|
@cubic-dev-ai re-run |
@sezallagwal I have started the AI code review. It will take a few minutes to complete. |
|
I have resolved the issues. Please have a look @ahmed-n-abdeltwab |
ahmed-n-abdeltwab
left a comment
There was a problem hiding this comment.
please take a look at these issues
|
Thanks for the detailed review, @ahmed-n-abdeltwab! I missed the individual thread comments before, but they’re all fixed in the latest commit. |
Proposed Changes
This PR integrates OpenAPI support into the
Rocket.Chat API, migratingchat.deleteandchat.reactendpoints to the new OpenAPI pattern. The update includes improved API documentation, enhanced type safety, and response validation using AJV.Key Changes:
ExtractRoutesFromAPIutility from the TypeScript definitions to dynamically derive routes from the endpoint specificationsTracked in: RocketChat/Rocket.Chat-Open-API#150
Testing
400validation errorEndpoints
Delete a chat message
POST /api/v1/chat.deleteSend a reaction
POST /api/v1/chat.reactSteps to Test or Reproduce
X-Auth-TokenandX-User-IdPOST /api/v1/chat.deleteand execute with:{ "msgId": "<id>", "roomId": "<rid>" }POST /api/v1/chat.reactand execute with:{ "emoji": ":thumbsup:", "messageId": "<id>" }{}400validation error.Swagger UI —

chat.delete:Swagger UI —

chat.react:Summary by CodeRabbit
New Features
Refactor
Notes