Skip to content

refactor: migrate rooms.favorite endpoint to new OpenAPI pattern with AJV validation#38929

Closed
Verifieddanny wants to merge 4 commits intoRocketChat:developfrom
Verifieddanny:refactor/migrate-rooms-favorite-endpoint
Closed

refactor: migrate rooms.favorite endpoint to new OpenAPI pattern with AJV validation#38929
Verifieddanny wants to merge 4 commits intoRocketChat:developfrom
Verifieddanny:refactor/migrate-rooms-favorite-endpoint

Conversation

@Verifieddanny
Copy link
Contributor

@Verifieddanny Verifieddanny commented Feb 23, 2026

refactor: migrate rooms.favorite endpoint to new OpenAPI pattern with AJV validation

Proposed changes (including videos or screenshots)

Migrates the rooms.favorite endpoint from the legacy API.v1.addRoute
pattern to the new OpenAPI-compliant format using AJV schema validation,
continuing the REST API migration effort across the codebase.

Key changes:

  • Replaced API.v1.addRoute with API.v1.post for rooms.favorite
  • Removed manual parameter validation in favour of declarative AJV body schema
  • Added oneOf constraint enforcing either roomId or roomName alongside
    favorite in the request body
  • Added explicit response schemas for 200, 400, and 401 status codes
  • Removed manually written type from packages/rest-typings/src/v1/rooms.ts
    since it is now auto-generated via ExtractRoutesFromAPI
  • Added changeset file

Swagger UI — endpoint documented at /api-docs/:
Screenshot from 2026-02-23 11-19-52

200 OK response:

Screenshot from 2026-02-23 11-37-30

400 on invalid body:

Screenshot from 2026-02-23 11-20-13

** UI Cange:**

Screenshot from 2026-02-23 11-44-00

Issue(s)

Part of the ongoing REST API migration effort, following:

Steps to test or reproduce

  1. Run the server locally with yarn dev
  2. Navigate to http://localhost:3000/api-docs/
  3. Authorize with X-Auth-Token and X-User-Id
  4. Find POST /api/v1/rooms.favorite
  5. Execute with valid body:
{
  "roomName": "GENERAL",
  "favorite": true
}
  1. Confirm 200 response with { "success": true }
  2. Execute with empty body {} to confirm 400 validation error

Further comments

This follows the exact same migration pattern established.
The business logic is unchanged — only the validation and type inference
approach has been updated.

Summary by CodeRabbit

  • Refactor
    • Moved the rooms.favorite endpoint to a new API surface with stricter request validation; marking/unmarking favorites still works via room ID or name.
  • Documentation
    • Added a changeset noting the patch-level migration to the new OpenAPI/AJV-based pattern.

@Verifieddanny Verifieddanny requested review from a team as code owners February 23, 2026 11:17
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 23, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 8.3.0, but it targets 8.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@CLAassistant
Copy link

CLAassistant commented Feb 23, 2026

CLA assistant check
All committers have signed the CLA.

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: 528a5d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Walkthrough

The rooms.favorite endpoint was moved from an inline route to an exported OpenAPI-style endpoint with AJV validation in the Meteor app; the previous public REST typing for the endpoint was removed and the new endpoint is exposed via module augmentation.

Changes

Cohort / File(s) Summary
Changeset Documentation
\.changeset/migrate-rooms-favorite-endpoint.md
Adds a patch-level changeset documenting the migration of the /v1/rooms.favorite endpoint to an OpenAPI/AJV pattern.
Meteor Endpoint Implementation
apps/meteor/app/api/server/v1/rooms.ts
Replaces inline route with exported roomsFavoriteEndpoint (API.v1.post) including AJV schema requiring roomId or roomName + favorite; resolves room via findRoomByIdOrName, invokes toggleFavoriteMethod, and returns explicit responses. Adds RoomsFavoriteEndpoint type and module augmentation to surface the endpoint.
REST Typings Cleanup
packages/rest-typings/src/v1/rooms.ts
Removes the old ('/v1/rooms.favorite') entry from the public RoomsEndpoints typings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped the endpoint to a tidy nest,
AJV checks each payload at its best,
From inline route to an exported name,
I toggle favorites — the rabbit claims fame! 🎈

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: migrating the rooms.favorite endpoint to a new OpenAPI pattern with AJV validation, which matches the core objective of the PR.

✏️ 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.

❤️ Share

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

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
apps/meteor/app/api/server/v1/rooms.ts (1)

350-354: Consider consolidating the two declare module '@rocket.chat/rest-typings' augmentation blocks.

Lines 352-354 add a second interface Endpoints augmentation in the same file; lines 1125-1127 already contain one for RoomEndpoints. Merging them reduces noise and follows the single-block pattern used elsewhere.

♻️ Suggested consolidation

Remove the block at lines 352-354 and fold the new endpoint into the existing augmentation at lines 1125-1127:

-type RoomsFavoriteEndpoint = ExtractRoutesFromAPI<typeof roomsFavoriteEndpoint>;
-
-declare module '@rocket.chat/rest-typings' {
-	interface Endpoints extends RoomsFavoriteEndpoint {}
-}

// ...later in the file (lines ~1123-1127)...
-type RoomEndpoints = ExtractRoutesFromAPI<typeof roomEndpoints> & ExtractRoutesFromAPI<typeof roomInviteEndpoints>;
+type RoomEndpoints = ExtractRoutesFromAPI<typeof roomEndpoints> & ExtractRoutesFromAPI<typeof roomInviteEndpoints> & ExtractRoutesFromAPI<typeof roomsFavoriteEndpoint>;

 declare module '@rocket.chat/rest-typings' {
 	// eslint-disable-next-line `@typescript-eslint/naming-convention`, `@typescript-eslint/no-empty-interface`
 	interface Endpoints extends RoomEndpoints {}
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/api/server/v1/rooms.ts` around lines 350 - 354, There are two
separate module augmentations for '@rocket.chat/rest-typings'—one declaring
interface Endpoints with RoomEndpoints and a second declaring Endpoints with
RoomsFavoriteEndpoint; remove the duplicate block containing
RoomsFavoriteEndpoint and add RoomsFavoriteEndpoint into the existing
augmentation that already contains RoomEndpoints so there is a single declare
module '@rocket.chat/rest-typings' { interface Endpoints extends RoomEndpoints,
RoomsFavoriteEndpoint {} } (update the existing augmentation to extend both
symbols).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/app/api/server/v1/rooms.ts`:
- Around line 341-345: The handler now calls findRoomByIdOrName with its default
checkedArchived:true which causes archived rooms to throw error-room-archived
and prevents toggleFavoriteMethod from running; update the action function to
call findRoomByIdOrName with checkedArchived:false so archived rooms can still
be unfavorited (i.e., pass { params: this.bodyParams, checkedArchived: false }
to findRoomByIdOrName) while leaving toggleFavoriteMethod(this.userId, room._id,
favorite) unchanged.
- Line 67: Remove the invalid import "import { required } from 'zod/mini';" —
the symbol "required" is not exported by zod/mini and is unused; delete this
import statement and ensure no other code relies on a standalone required symbol
(keep using .required() on Zod schemas or string literals "required" where
appropriate).

---

Nitpick comments:
In `@apps/meteor/app/api/server/v1/rooms.ts`:
- Around line 350-354: There are two separate module augmentations for
'@rocket.chat/rest-typings'—one declaring interface Endpoints with RoomEndpoints
and a second declaring Endpoints with RoomsFavoriteEndpoint; remove the
duplicate block containing RoomsFavoriteEndpoint and add RoomsFavoriteEndpoint
into the existing augmentation that already contains RoomEndpoints so there is a
single declare module '@rocket.chat/rest-typings' { interface Endpoints extends
RoomEndpoints, RoomsFavoriteEndpoint {} } (update the existing augmentation to
extend both symbols).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 133da0b and d4cb375.

📒 Files selected for processing (3)
  • .changeset/migrate-rooms-favorite-endpoint.md
  • apps/meteor/app/api/server/v1/rooms.ts
  • packages/rest-typings/src/v1/rooms.ts
💤 Files with no reviewable changes (1)
  • packages/rest-typings/src/v1/rooms.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/v1/rooms.ts
🧠 Learnings (2)
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.

Applied to files:

  • .changeset/migrate-rooms-favorite-endpoint.md
  • apps/meteor/app/api/server/v1/rooms.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.

Applied to files:

  • apps/meteor/app/api/server/v1/rooms.ts
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/rooms.ts (3)
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (1)
  • favorite (348-350)
apps/meteor/app/api/server/ApiClass.ts (1)
  • ExtractRoutesFromAPI (74-78)
packages/rest-typings/src/index.ts (1)
  • Endpoints (48-93)
🔇 Additional comments (1)
.changeset/migrate-rooms-favorite-endpoint.md (1)

1-5: LGTM!

Patch-level bump is appropriate for an internal refactor with no consumer-visible runtime change.

Comment on lines +341 to +345
async function action() {
const { favorite } = this.bodyParams;
const room = await findRoomByIdOrName({ params: this.bodyParams });

if (!this.bodyParams.hasOwnProperty('favorite')) {
return API.v1.failure("The 'favorite' param is required");
}
await toggleFavoriteMethod(this.userId, room._id, favorite);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

findRoomByIdOrName with the default checkedArchived: true may silently block favoriting archived rooms.

The old endpoint did not go through findRoomByIdOrName (per the AI summary, room resolution "now" happens here), so users who had archived rooms in their favorites could previously still toggle them. With checkedArchived: true the handler now throws error-room-archived before reaching toggleFavoriteMethod, making the behavior change inconsistent with the PR claim that "business logic is unchanged."

If archiving a room should not prevent it from being un-favorited, pass checkedArchived: false:

🐛 Proposed fix
-	const room = await findRoomByIdOrName({ params: this.bodyParams });
+	const room = await findRoomByIdOrName({ params: this.bodyParams, checkedArchived: false });
#!/bin/bash
# Check what the old rooms.favorite addRoute handler did before this PR (git blame / old code search)
rg -n 'rooms\.favorite' apps/meteor/app/api/server/v1/rooms.ts
rg -n 'toggleFavorite' apps/meteor/app/api/server/v1/rooms.ts
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/api/server/v1/rooms.ts` around lines 341 - 345, The handler
now calls findRoomByIdOrName with its default checkedArchived:true which causes
archived rooms to throw error-room-archived and prevents toggleFavoriteMethod
from running; update the action function to call findRoomByIdOrName with
checkedArchived:false so archived rooms can still be unfavorited (i.e., pass {
params: this.bodyParams, checkedArchived: false } to findRoomByIdOrName) while
leaving toggleFavoriteMethod(this.userId, room._id, favorite) unchanged.

@ggazzo ggazzo added this to the 8.3.0 milestone Feb 23, 2026
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.66%. Comparing base (133da0b) to head (d4cb375).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38929      +/-   ##
===========================================
+ Coverage    70.56%   70.66%   +0.10%     
===========================================
  Files         3189     3189              
  Lines       112702   112716      +14     
  Branches     20429    20425       -4     
===========================================
+ Hits         79526    79650     +124     
+ Misses       31115    31016      -99     
+ Partials      2061     2050      -11     
Flag Coverage Δ
unit 71.22% <ø> (-0.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ahmed-n-abdeltwab
Copy link
Contributor

ahmed-n-abdeltwab commented Feb 23, 2026

I already have a PR open for this one. You should trace my existing PR here: RocketChat/Rocket.Chat-Open-API#150 before opening any new ones. so we don't have collisions between our PRs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
apps/meteor/app/api/server/v1/rooms.ts (1)

345-345: ⚠️ Potential issue | 🟡 Minor

findRoomByIdOrName still uses checkedArchived: true (default), blocking archivied-room favorite toggles.

This was raised in a previous review and remains unaddressed. The business logic claim in the PR ("unchanged") may not hold: the old addRoute handler did not call findRoomByIdOrName, so archived rooms could previously be (un-)favorited. With the default checkedArchived: true, the endpoint now throws error-room-archived before toggleFavoriteMethod is reached.

🐛 Proposed fix
-	const room = await findRoomByIdOrName({ params: this.bodyParams });
+	const room = await findRoomByIdOrName({ params: this.bodyParams, checkedArchived: false });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/api/server/v1/rooms.ts` at line 345, The handler calls
findRoomByIdOrName({ params: this.bodyParams }) which uses the default
checkedArchived: true and thus blocks archived-room favorite toggles before
toggleFavoriteMethod runs; change the call to pass checkedArchived: false (e.g.,
findRoomByIdOrName({ params: this.bodyParams, checkedArchived: false })) so
archived rooms are returned and toggleFavoriteMethod can handle (un)favoriting;
update any related error handling or tests to reflect that the archived check is
deferred to toggleFavoriteMethod.
🧹 Nitpick comments (1)
apps/meteor/app/api/server/v1/rooms.ts (1)

333-338: Add a TypeScript generic to the 200-response ajv.compile call for consistency.

Other endpoints in this file (e.g., roomInviteEndpoints at line 1105) use ajv.compile<void>({...}) for success-only responses. Omitting the generic is not a runtime problem, but it diverges from the established pattern.

♻️ Proposed fix
-		200: ajv.compile({
+		200: ajv.compile<void>({
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/api/server/v1/rooms.ts` around lines 333 - 338, The
200-response ajv.compile call lacks the TypeScript generic used elsewhere;
update the ajv.compile invocation for the 200 response (the object schema with
properties: { success: { type: 'boolean', enum: [true] } }) to include the
<void> generic to match the established pattern (as used in roomInviteEndpoints)
so the call becomes ajv.compile<void>(...) for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@apps/meteor/app/api/server/v1/rooms.ts`:
- Line 345: The handler calls findRoomByIdOrName({ params: this.bodyParams })
which uses the default checkedArchived: true and thus blocks archived-room
favorite toggles before toggleFavoriteMethod runs; change the call to pass
checkedArchived: false (e.g., findRoomByIdOrName({ params: this.bodyParams,
checkedArchived: false })) so archived rooms are returned and
toggleFavoriteMethod can handle (un)favoriting; update any related error
handling or tests to reflect that the archived check is deferred to
toggleFavoriteMethod.

---

Nitpick comments:
In `@apps/meteor/app/api/server/v1/rooms.ts`:
- Around line 333-338: The 200-response ajv.compile call lacks the TypeScript
generic used elsewhere; update the ajv.compile invocation for the 200 response
(the object schema with properties: { success: { type: 'boolean', enum: [true] }
}) to include the <void> generic to match the established pattern (as used in
roomInviteEndpoints) so the call becomes ajv.compile<void>(...) for consistency.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4cb375 and 528a5d6.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/rooms.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/v1/rooms.ts
🧠 Learnings (4)
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.

Applied to files:

  • apps/meteor/app/api/server/v1/rooms.ts
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.

Applied to files:

  • apps/meteor/app/api/server/v1/rooms.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/api/server/v1/rooms.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • apps/meteor/app/api/server/v1/rooms.ts
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/rooms.ts (2)
apps/meteor/app/api/server/ApiClass.ts (1)
  • ExtractRoutesFromAPI (74-78)
packages/rest-typings/src/index.ts (1)
  • Endpoints (48-93)
🔇 Additional comments (1)
apps/meteor/app/api/server/v1/rooms.ts (1)

353-358: LGTM!

Type extraction via ExtractRoutesFromAPI and the module augmentation are consistent with the existing RoomEndpoints pattern at lines 1127–1131.

@Verifieddanny
Copy link
Contributor Author

Ohh ok, my bad @ahmed-n-abdeltwab

So do I close this or leave it as I have already migrated for the "rooms.favorite" to the new OpenAPI pattern

As I am more particular about contributing immensely to this part of the project moving forward

@Verifieddanny
Copy link
Contributor Author

@ggazzo Thanks for the approval

I've pulled changes from develop branch to my branch now

@ggazzo
Copy link
Member

ggazzo commented Feb 23, 2026

I just noticed that the file is duplicated. If @ahmed-n-abdeltwab doesnt mind, I'll merge this one; otherwise, I'll wait for him to correct what I asked him to fix in the other one.

@Verifieddanny
Copy link
Contributor Author

Ok thank you, can I still be contributing to the api migration moving forward?

@ggazzo
Copy link
Member

ggazzo commented Feb 23, 2026

Ok thank you, can I still be contributing to the api migration moving forward?

sure, just look to see if there isn't already an open pr for the same thing

@ggazzo ggazzo closed this Feb 23, 2026
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.

4 participants