chore: migrate low-friction DDP callers to REST endpoints
Merged
GG
5mo ago+111+111+012345678901234567890123456789-43-43-01234567890123456789
Summary
Replaces 6 client-side DDP callers with their REST equivalents. Each one was a 1:1 swap — same parameters, same response shape (or trivially destructured). The DDP methods stay registered on the server for external SDK/mobile clients until the 9.0.0 sweep removes them.
Methods migrated
| Method | REST | Caller(s) |
|---|---|---|
license:isEnterprise | GET /v1/licenses.info (license.hasValidLicense) | useRestrictedRoles.ts |
license:getModules | GET /v1/licenses.info (license.activeModules) | fetchFeatures.ts |
banner/dismiss | POST /v1/banners.dismiss | useDismissUserBannerMutation.ts |
setReaction | POST /v1/chat.react | processSetReaction.ts |
slashCommand | POST /v1/commands.run | processSlashCommand.ts |
e2e.resetOwnE2EKey | POST /v1/users.resetE2EKey | useResetE2EPasswordMutation.ts |
Methods skipped (need design work, separate PRs)
These looked easy but the REST endpoint diverges in shape, accepts a different param, or restricts room types — listed in docs/ddp-migration-checklist.md:
userSetUtcOffset—/v1/users.setPreferencesdoesn't exposeutcOffset.requestDataDownload— REST stripspendingOperationsBeforeMyRequest+urlfields the caller uses.deleteFileMessage— DDP takesfileID, RESTchat.deletetakesmsgId + roomId.joinRoom— RESTchannels.joinonly findst === 'c' | 'l'rooms; DDP is generic.leaveRoom— needs per-room-type dispatch (channels.leave/groups.leave/im.leave).addUsersToRoom— same dispatch issue (channels.invite/groups.invite).spotlight— REST drops theusernamesfilter andtypeconfig.loadMissedMessages— RESTchat.syncMessagesreturns serialized timestamps + different cursor shape.readThreads— RESTsubscriptions.readoperates on subscriptions; DDP marks the thread tmid.registerUser— RESTusers.createrequires admin permissions; DDP is anonymous-sign-up entry.
Test plan
- Login as a workspace where
license.hasValidLicenseis true — guest role still getsview-d-room/view-joined-room/etc. -
fetchFeaturespopulates the modules list (check feature flags pages). - Dismiss a workspace banner — toast on error, banner gone on success.
- Send
+:emoji:as a single line — reaction applies to the previous message. - Run a slash command (
/help,/leave, etc.) — output appears, errors show toast. - Reset own E2E password — toast success, logged out.
Summary by CodeRabbit
- Refactor
- Multiple client flows now call REST endpoints (reactions, slash commands, license checks, banner dismissal, E2E reset, role checks, leave room, add users/invite flows).
- Group/user payload shape extended to accept multiple user-identification forms.
- Bug Fix
- Reaction failures show an error toast to users.
- Deprecation
- Several legacy server methods now emit deprecation warnings; one commands parameter made optional.
Task: ARCH-2162