Skip to content

chore: migrate roles.sync endpoint to chained API pattern with AJV validation#39196

Open
NAME-ASHWANIYADAV wants to merge 3 commits intoRocketChat:developfrom
NAME-ASHWANIYADAV:chore/migrate-roles-sync-openapi
Open

chore: migrate roles.sync endpoint to chained API pattern with AJV validation#39196
NAME-ASHWANIYADAV wants to merge 3 commits intoRocketChat:developfrom
NAME-ASHWANIYADAV:chore/migrate-roles-sync-openapi

Conversation

@NAME-ASHWANIYADAV
Copy link
Contributor

@NAME-ASHWANIYADAV NAME-ASHWANIYADAV commented Feb 28, 2026

Closes #39195

Changes

  • Migrated roles.sync GET endpoint from legacy API.v1.addRoute to the new chained .get() API pattern
  • Replaced Meteor check/Match input validation with AJV schema validation for the updatedSince query parameter
  • Added AJV response schema validation for the 200 response (roles.update and roles.remove arrays)
  • Removed manual RoleSyncProps type and '/v1/roles.sync' endpoint definition from rest-typings (now auto-inferred via ExtractRoutesFromAPI)
  • Removed unused check/Match imports from meteor/check

Files Changed

  • apps/meteor/app/api/server/v1/roles.ts — endpoint migration
  • packages/rest-typings/src/v1/roles.ts — removed manual type definitions

No behavioral changes

The endpoint logic remains identical — only the validation and registration pattern has been updated.

Related project

This continues the REST API migration effort described in the GSoC 2026 project: Replace old REST API definitions over the new API.

cc @diego-sampaio @ggazzo

Summary by CodeRabbit

  • Refactor

    • Reorganized roles API routing; consolidated endpoints into a chained routing pattern and improved request/response validation for more consistent behavior.
  • Bug Fixes

    • Strengthened query and date handling for role synchronization to prevent invalid-date errors.
  • Chores

    • Updated the public response shape for fetching users in public roles.
    • Removed the public-facing roles.sync endpoint from the public typings.

@NAME-ASHWANIYADAV NAME-ASHWANIYADAV requested review from a team as code owners February 28, 2026 18:39
@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2026

⚠️ No Changeset found

Latest commit: b5a2349

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 28, 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 missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e670c1e and b5a2349.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/roles.ts
📜 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)
  • GitHub Check: cubic · AI code reviewer
🧰 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/roles.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
📚 Learning: 2026-02-24T19:09:01.522Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:01.522Z
Learning: In Rocket.Chat OpenAPI migration PRs for endpoints under apps/meteor/app/api/server/v1, avoid introducing logic changes. Only perform scope-tight changes that preserve behavior; style-only cleanups (e.g., removing inline comments) may be deferred to follow-ups to keep the migration PR focused.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.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/roles.ts
📚 Learning: 2026-01-26T18:26:01.279Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38227
File: apps/meteor/app/api/server/router.ts:44-49
Timestamp: 2026-01-26T18:26:01.279Z
Learning: In apps/meteor/app/api/server/router.ts, when retrieving bodyParams and queryParams from the Hono context via c.get(), do not add defensive defaults (e.g., ?? {}). The code should fail fast if these parameters are missing, as endpoint handlers expect them to be present and breaking here helps surface parsing problems rather than hiding them.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-23T17:53:06.802Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:06.802Z
Learning: During PR reviews that touch endpoint files under apps/meteor/app/api/server/v1, enforce strict scope: if a PR targets a specific endpoint (e.g., rooms.favorite), do not propose changes to unrelated endpoints (e.g., rooms.invite) unless maintainers explicitly request them. Focus feedback on the touched endpoint's behavior, API surface, and related tests; avoid broad cross-endpoint changes in the same PR unless requested.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/roles.ts (3)
apps/meteor/app/api/server/index.ts (1)
  • API (51-51)
packages/apps/src/AppsEngine.ts (1)
  • IRole (15-15)
packages/models/src/index.ts (1)
  • Roles (180-180)
🔇 Additional comments (2)
apps/meteor/app/api/server/v1/roles.ts (2)

240-245: Add schema-level RFC3339 validation for updatedSince to avoid permissive date parsing.

Line 240-245 still validates only type: 'string', so values like loosely parseable non-ISO strings can pass schema and rely on Date.parse behavior. Prefer enforcing format: 'date-time' in AJV, then keep the runtime guard as defense-in-depth.

Proposed patch
 			query: ajv.compile<{ updatedSince: string }>({
 				type: 'object',
 				properties: {
 					updatedSince: {
 						type: 'string',
+						format: 'date-time',
 					},
 				},
 				required: ['updatedSince'],
 				additionalProperties: false,
 			}),
@@
 		async function () {
 			const { updatedSince } = this.queryParams;
-
-			if (Number.isNaN(Date.parse(updatedSince))) {
+			const updatedSinceDate = new Date(updatedSince);
+			if (Number.isNaN(updatedSinceDate.getTime())) {
 				throw new Meteor.Error('error-updatedSince-param-invalid', 'The "updatedSince" query parameter must be a valid date.');
 			}
-
-			const updatedSinceDate = new Date(updatedSince);
#!/bin/bash
# Verify date-time format usage in migrated v1 endpoints for consistency
rg -n -C2 "updatedSince|format:\s*'date-time'|format:\s*\"date-time\"" apps/meteor/app/api/server/v1/

Also applies to: 275-280


204-235: Chained route migration for roles.getUsersInPublicRoles looks good.

Line 204-235 keeps the endpoint behavior focused while aligning with the new chained API + typed AJV response pattern.

Based on learnings: In Rocket.Chat OpenAPI migration PRs for endpoints under apps/meteor/app/api/server/v1, avoid introducing logic changes and keep scope tight.


Walkthrough

Replaced the standalone roles.sync addRoute with chained API.v1.get() routes; migrated roles.sync to AJV-validated query/response schemas and explicit Date handling; moved roles.getUsersInPublicRoles into the same chained route with a typed 200 response delegating user retrieval to Authorization.

Changes

Cohort / File(s) Summary
API implementation
apps/meteor/app/api/server/v1/roles.ts
Removed standalone API.v1.addRoute usage; added chained API.v1.get() routes for roles.getUsersInPublicRoles and roles.sync; replaced Meteor check/Match with AJV query/response schemas; handler parses updatedSince to Date and returns update and remove arrays.
Public REST typings
packages/rest-typings/src/v1/roles.ts
Removed the public endpoint entry for '/v1/roles.sync' from RolesEndpoints, deleting its prior response shape.
Type augmentation / exports
apps/meteor/app/api/server/v1/roles.ts (module augmentation)
Updated Endpoints augmentation to derive RolesEndpoints from the new rolesRoutes via ExtractRoutesFromAPI, adjusting exported REST typings to match the new route definitions.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Client
participant API as API.v1
participant Auth as Authorization
participant RolesDB as Roles Model
Client->>API: GET /v1/roles.sync?updatedSince=...
API->>API: AJV validate query
API->>RolesDB: query roles updated since Date
API->>RolesDB: query roles deleted/trash since Date
RolesDB-->>API: return updated roles, removed roles
API->>Client: 200 { update: [...], remove: [...] }
Client->>API: GET /v1/roles.getUsersInPublicRoles
API->>API: route handling / typed 200 response
API->>Auth: Authorization.getUsersFromPublicRoles()
Auth-->>API: users[]
API->>Client: 200 users[]

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: migrating the roles.sync endpoint from legacy API.v1.addRoute pattern to chained API with AJV validation, which aligns with the PR objectives.
Linked Issues check ✅ Passed All coding objectives from issue #39195 are met: endpoint migrated to chained API pattern, validation changed from Meteor check/Match to AJV, response schema validation added, and manual type definitions removed for auto-inference.
Out of Scope Changes check ✅ Passed All changes are directly related to migrating roles.sync endpoint to chained API pattern with AJV validation per issue #39195; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 2 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: 1

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

251-264: Tighten roles.sync remove response typing/schema.

remove: object[] plus items: { type: 'object' } is too permissive and dilutes the response contract for generated typings.

💡 Suggested direction
 					roles: {
 						update: IRole[];
-						remove: object[];
+						remove: { _id: string }[];
 					};
 				}>({
@@
 								update: { type: 'array', items: { type: 'object' } },
-								remove: { type: 'array', items: { type: 'object' } },
+								remove: {
+									type: 'array',
+									items: {
+										type: 'object',
+										properties: { _id: { type: 'string' } },
+										required: ['_id'],
+										additionalProperties: true,
+									},
+								},
 							},
 							required: ['update', 'remove'],
 						},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/api/server/v1/roles.ts` around lines 251 - 264, Tighten the
permissive remove typing by replacing the generic object[] with a concrete
shape: update the ajv.compile generic to { roles: { update: IRole[]; remove: {
_id: string }[] } } (or your actual removed-role identifier field) and replace
the schema for remove under roles with an array item schema that defines the
expected properties (e.g., items: { type: "object", properties: { _id: { type:
"string" } }, required: ["_id"] }). Update any other places that rely on the old
remove shape to use the new { _id: string }[] type; locate the change at the
ajv.compile call and the nested roles -> remove schema in roles.ts.
🤖 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/roles.ts`:
- Around line 240-245: The schema for the query compiled with ajv.compile<{
updatedSince: string }> should enforce an RFC3339 datetime: add "format":
"date-time" to the updatedSince property and recompile the schema; additionally,
after parsing the string into a Date in the request handler (the code that
currently does new Date(updatedSince)), add the same runtime validation pattern
used by validateDateParam in emoji-custom.ts — i.e. check isNaN(date.getTime())
and return/throw a clear bad-request error if invalid — and apply the same
schema+runtime validation for the second occurrence around the block at lines
referenced 273-279 (the other updatedSince handler).

---

Nitpick comments:
In `@apps/meteor/app/api/server/v1/roles.ts`:
- Around line 251-264: Tighten the permissive remove typing by replacing the
generic object[] with a concrete shape: update the ajv.compile generic to {
roles: { update: IRole[]; remove: { _id: string }[] } } (or your actual
removed-role identifier field) and replace the schema for remove under roles
with an array item schema that defines the expected properties (e.g., items: {
type: "object", properties: { _id: { type: "string" } }, required: ["_id"] }).
Update any other places that rely on the old remove shape to use the new { _id:
string }[] type; locate the change at the ajv.compile call and the nested roles
-> remove schema in roles.ts.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c30636 and e6ccc9c.

📒 Files selected for processing (2)
  • apps/meteor/app/api/server/v1/roles.ts
  • packages/rest-typings/src/v1/roles.ts
📜 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)
  • GitHub Check: cubic · AI code reviewer
🧰 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:

  • packages/rest-typings/src/v1/roles.ts
  • apps/meteor/app/api/server/v1/roles.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • packages/rest-typings/src/v1/roles.ts
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.

Applied to files:

  • packages/rest-typings/src/v1/roles.ts
  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/rest-typings/src/v1/roles.ts
  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/rest-typings/src/v1/roles.ts
  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-24T19:09:01.522Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:01.522Z
Learning: In Rocket.Chat OpenAPI migration PRs for endpoints under apps/meteor/app/api/server/v1, avoid introducing logic changes. Only perform scope-tight changes that preserve behavior; style-only cleanups (e.g., removing inline comments) may be deferred to follow-ups to keep the migration PR focused.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
📚 Learning: 2026-02-23T17:53:06.802Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:06.802Z
Learning: During PR reviews that touch endpoint files under apps/meteor/app/api/server/v1, enforce strict scope: if a PR targets a specific endpoint (e.g., rooms.favorite), do not propose changes to unrelated endpoints (e.g., rooms.invite) unless maintainers explicitly request them. Focus feedback on the touched endpoint's behavior, API surface, and related tests; avoid broad cross-endpoint changes in the same PR unless requested.

Applied to files:

  • apps/meteor/app/api/server/v1/roles.ts
🧬 Code graph analysis (1)
apps/meteor/app/api/server/v1/roles.ts (6)
apps/meteor/app/api/server/index.ts (1)
  • API (51-51)
packages/apps/src/AppsEngine.ts (1)
  • IRole (15-15)
packages/models/src/index.ts (1)
  • Roles (180-180)
packages/rest-typings/src/v1/roles.ts (1)
  • RolesEndpoints (116-145)
apps/meteor/app/api/server/ApiClass.ts (1)
  • ExtractRoutesFromAPI (74-78)
packages/rest-typings/src/index.ts (1)
  • Endpoints (48-93)
🔇 Additional comments (2)
apps/meteor/app/api/server/v1/roles.ts (1)

204-235: Good scoped migration to chained route registration.

The roles.getUsersInPublicRoles move to chained .get() with response validation is clean and keeps behavior-focused scope.

packages/rest-typings/src/v1/roles.ts (1)

116-145: The removal of /v1/roles.sync from RolesEndpoints is clean; no remaining references to this endpoint exist in the codebase.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.69%. Comparing base (3c30636) to head (e670c1e).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39196      +/-   ##
===========================================
- Coverage    70.76%   70.69%   -0.07%     
===========================================
  Files         3195     3195              
  Lines       113106   113106              
  Branches     20522    20517       -5     
===========================================
- Hits         80041    79962      -79     
- Misses       31018    31100      +82     
+ Partials      2047     2044       -3     
Flag Coverage Δ
unit 71.29% <ø> (-0.13%) ⬇️

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.

@ggazzo
Copy link
Member

ggazzo commented Mar 2, 2026

please @NAME-ASHWANIYADAV run lint/typecheck locally before pushing the changes

CI / 🔎 Code Check / Code Lint (pull_request)

@NAME-ASHWANIYADAV
Copy link
Contributor Author

Hi @ggazzo, lint issues are fixed and CI is green. Could you please review and merge when you get a chance? 🙏

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

Projects

Development

Successfully merging this pull request may close these issues.

roles.sync endpoint still uses legacy

2 participants