Area
services/platform/convex/members/mutations.ts — removeMember, updateMemberRole, updateMemberName, transferOwnership mutations.
Steps to reproduce
- Attempt to remove a member as a non-admin, or try to remove the org owner.
- Attempt to change a member's role when not an admin, or try to assign the owner role manually.
- Any error is surfaced to the client as an opaque "Server Error" instead of a structured
ConvexError.
Expected
All user-facing rejections — Unauthenticated, Member not found, Only admins can remove/update, The organization owner cannot be removed, The owner role cannot be assigned manually — should be ConvexError({ code: ... }).
Actual
All error paths across the four public mutations throw new Error(string):
removeMember: Unauthenticated, Member not found, Only admins can remove members, The organization owner cannot be removed
updateMemberRole: Unauthenticated, Member not found, Only admins can update member roles, The organization owner role cannot be changed, The owner role cannot be assigned manually, The organization creator role cannot be changed
updateMemberName: Unauthenticated, Member not found, Only admins can update other members names
transferOwnership: Unauthenticated, Member not found, Only the organization owner can transfer ownership, Target member is already the owner
Evidence
services/platform/convex/members/mutations.ts:140-174 — removeMember
services/platform/convex/members/mutations.ts:248-309 — updateMemberRole
services/platform/convex/members/mutations.ts:520-562 — updateMemberName
services/platform/convex/members/mutations.ts:404-437 — transferOwnership
Notes
tasks/mutations.ts uses ConvexError({ code: 'UNAUTHENTICATED' }) as the correct pattern. Member mutations should be aligned.
Area
services/platform/convex/members/mutations.ts—removeMember,updateMemberRole,updateMemberName,transferOwnershipmutations.Steps to reproduce
ConvexError.Expected
All user-facing rejections — Unauthenticated, Member not found, Only admins can remove/update, The organization owner cannot be removed, The owner role cannot be assigned manually — should be
ConvexError({ code: ... }).Actual
All error paths across the four public mutations throw
new Error(string):removeMember: Unauthenticated, Member not found, Only admins can remove members, The organization owner cannot be removedupdateMemberRole: Unauthenticated, Member not found, Only admins can update member roles, The organization owner role cannot be changed, The owner role cannot be assigned manually, The organization creator role cannot be changedupdateMemberName: Unauthenticated, Member not found, Only admins can update other members namestransferOwnership: Unauthenticated, Member not found, Only the organization owner can transfer ownership, Target member is already the ownerEvidence
services/platform/convex/members/mutations.ts:140-174—removeMemberservices/platform/convex/members/mutations.ts:248-309—updateMemberRoleservices/platform/convex/members/mutations.ts:520-562—updateMemberNameservices/platform/convex/members/mutations.ts:404-437—transferOwnershipNotes
tasks/mutations.tsusesConvexError({ code: 'UNAUTHENTICATED' })as the correct pattern. Member mutations should be aligned.