Rename workspaces actor param to actingUserId (PR 1 of 3) - #35
Conversation
Mirrors server commit ecf63b6. Workspaces was the only bundle naming the acting user `userId`; this repo already used `actingUserId` in its chat modules, so workspaces was the outlier here too. Renamed across 14 modules — four more than the server's controller count. updateWorkspace, updateWorkspaceInheritFlag, deleteWorkspace and transferWorkspaceOwnership take their actor from requireWorkspaceCapability's resolveActor rather than their own controller, so the server's middleware change means leaving them on `userId` would have silently broken the service-key act-as-user path on those endpoints. createWorkspaceInvite's invitee `userId` and all targetUserId params are untouched. Part 1 of 3 (plan-workspace-rank-ergonomics.md). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughWorkspace module inputs and HTTP request fields now use ChangesWorkspace identity migration
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR standardizes the workspace acting-user parameter name without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Mirrors sublay-io/server-hosted#125. Merge after the server PR.
What
Renamed the acting-user param
userId→actingUserIdacross 14 workspace modules, matching the convention this repo already uses insrc/modules/chat/(addMember,removeMember,changeMemberRole,createDirectConversation).14 modules, not 10. Four endpoints —
updateWorkspace,updateWorkspaceInheritFlag,deleteWorkspace,transferWorkspaceOwnership— take their actor from the capability middleware rather than their own controller. The server PR changes that middleware to readactingUserId, so leaving these four onuserIdwould have silently broken the service-key act-as-user path on them.Untouched:
createWorkspaceInvite's inviteeuserId, and everytargetUserId.Caveat worth knowing
On those same four endpoints the field is currently discarded — the guard grants a key full authority before it resolves the named user. PR 2 fixes it; the docs PR carries warnings in the meantime. Renaming them now is still correct: it keeps the wire contract consistent so PR 2 only has to change behavior, not names.
Verification
421 tests passing,
tsc --noEmitclean, tsup build (ESM/CJS/DTS) succeeds.🤖 Generated with Claude Code
Summary by CodeRabbit
Improvements
actingUserIdfield.Tests