refactor: swap method.call/addUsersToRoom for per-type REST endpoints#40723
refactor: swap method.call/addUsersToRoom for per-type REST endpoints#40723Copilot wants to merge 3 commits into
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 |
|
Replace the DDP method.call/addUsersToRoom helper with per-type REST endpoints: - type 'c' → POST /v1/channels.invite - type 'p' → POST /v1/groups.invite - type 'd' → fallback to method.call (no REST equivalent for DM invites) Update federation test assertions from DDP error shape (JSON.parse(body.message).error.error) to REST envelope (body.errorType), and success assertions from DDP result string to REST response shape (body.group).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40723 +/- ##
===========================================
+ Coverage 69.72% 69.73% +0.01%
===========================================
Files 3326 3326
Lines 123056 123090 +34
Branches 21976 21948 -28
===========================================
+ Hits 85797 85835 +38
Misses 33905 33905
+ Partials 3354 3350 -4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@copilot check lint task |
The lint failure was two prettier errors in |
|
/jira FGA |
|
The milestone "8.6.0" does not exist on the Jira board; the task was created without Fix version. |
The
addUserToRoomtest helper used the legacy DDPmethod.call/addUsersToRoomendpoint. Federation tests asserted the DDP error shape (JSON.parse(body.message).error.error) instead of the REST envelope ({ success: false, errorType }).Changes
apps/meteor/tests/data/rooms.helper.ts— Added requiredtype: IRoom['t']parameter routing to the appropriate endpoint:'c'→POST /v1/channels.invite'p'→POST /v1/groups.invite'd'→ falls back tomethod.call(no REST equivalent for DM invites)Federation test assertions (
room.spec.ts,permissions.spec.ts) — Migrated from DDP error shape to REST envelope:Success assertions updated from DDP result string (
body.messagematching{"msg":"result",...}) to REST shape (body.group).DM tests (
dms.spec.ts) — Passtype: 'd'; assertions unchanged since DDP fallback is preserved.Other callers (
chat.ts,uploads.helper.ts) — Pass explicit room type.Task: FGA-67