Skip to content

refactor(api): migrate rooms#39825

Merged
ggazzo merged 8 commits intochore/apisfrom
chore/apis-rooms
Mar 23, 2026
Merged

refactor(api): migrate rooms#39825
ggazzo merged 8 commits intochore/apisfrom
chore/apis-rooms

Conversation

@ggazzo
Copy link
Copy Markdown
Member

@ggazzo ggazzo commented Mar 23, 2026

…ge parameter

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

…se schema

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Summary by CodeRabbit

  • Improvements
    • Enhanced consistency and validation of room management API endpoints for more reliable request handling and standardized error responses.

ggazzo and others added 6 commits March 23, 2026 16:36
…se schema

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ssions to typed endpoints

Skips rooms.createDiscussion (has TODO for 8.0 validation) and
rooms.media* (uses this.incoming for multipart uploads).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@dionisio-bot
Copy link
Copy Markdown
Contributor

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

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

⚠️ No Changeset found

Latest commit: 1dec357

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3861a243-f9a8-4c1e-916e-cc2c1032b2ad

📥 Commits

Reviewing files that changed from the base of the PR and between a7f20f0 and 1dec357.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/rooms.ts

Walkthrough

The pull request migrates several API endpoints in rooms.ts from the legacy API.v1.addRoute pattern to a typed route builder style (API.v1.get, API.v1.post) with explicit AJV response schemas. This improves type safety and validation across endpoints including nameExists, get, cleanHistory, info, getDiscussions, images, muteUser, unmuteUser, and open.

Changes

Cohort / File(s) Summary
GET Endpoints Migration
apps/meteor/app/api/server/v1/rooms.ts (rooms.nameExists, rooms.get, rooms.info, rooms.getDiscussions, rooms.images)
Migrated from addRoute to API.v1.get with explicit AJV response schemas for 200 and error responses (400, 401, 403). Parameter validation updated from validateParams to query. Response structures now explicitly defined with success property and endpoint-specific fields (e.g., update/remove arrays for rooms.get, room and optional team/parent for rooms.info).
POST Endpoints Migration
apps/meteor/app/api/server/v1/rooms.ts (rooms.cleanHistory, rooms.muteUser, rooms.unmuteUser, rooms.open)
Migrated from addRoute to API.v1.post with AJV-backed response validation. Parameter validation updated from validateParams to body. All endpoints now use shared or endpoint-specific response schemas with success: true and explicit 400/401 error validators. Handlers refactored to async function action() pattern.
Shared Schema Addition
apps/meteor/app/api/server/v1/rooms.ts
Introduced new successResponseSchema constant as an AJV-compiled schema (with success: true property) for use across mute/unmute/open endpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

type: chore


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.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.56%. Comparing base (a7f20f0) to head (1dec357).
⚠️ Report is 2 commits behind head on chore/apis.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##           chore/apis   #39825      +/-   ##
==============================================
+ Coverage       70.53%   70.56%   +0.03%     
==============================================
  Files            3256     3256              
  Lines          115791   115791              
  Branches        21070    21033      -37     
==============================================
+ Hits            81673    81710      +37     
+ Misses          32046    32019      -27     
+ Partials         2072     2062      -10     
Flag Coverage Δ
e2e 60.41% <ø> (+0.09%) ⬆️
e2e-api 48.09% <ø> (-0.03%) ⬇️
unit 71.13% <ø> (+0.01%) ⬆️

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 ggazzo marked this pull request as ready for review March 23, 2026 23:18
@ggazzo ggazzo requested a review from a team as a code owner March 23, 2026 23:18
@ggazzo ggazzo merged commit ca17e18 into chore/apis Mar 23, 2026
43 of 45 checks passed
@ggazzo ggazzo deleted the chore/apis-rooms branch March 23, 2026 23:18
Copy link
Copy Markdown
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 1 file

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant