refactor: swap method.call/addUsersToRoom for per-type REST endpoints#40723
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 |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40723 +/- ##
========================================
Coverage 68.71% 68.72%
========================================
Files 4151 4151
Lines 159491 159516 +25
Branches 27999 27974 -25
========================================
+ Hits 109596 109622 +26
- Misses 44722 44726 +4
+ Partials 5173 5168 -5
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. |
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).
8dce3ac to
2c54b3c
Compare
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