Skip to content

Bug: members/mutations.ts — member management throws raw Error for all auth/permission/business rejections #2006

Description

@yannickmonney

Area

services/platform/convex/members/mutations.tsremoveMember, updateMemberRole, updateMemberName, transferOwnership mutations.

Steps to reproduce

  1. Attempt to remove a member as a non-admin, or try to remove the org owner.
  2. Attempt to change a member's role when not an admin, or try to assign the owner role manually.
  3. 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-174removeMember
  • services/platform/convex/members/mutations.ts:248-309updateMemberRole
  • services/platform/convex/members/mutations.ts:520-562updateMemberName
  • services/platform/convex/members/mutations.ts:404-437transferOwnership

Notes

tasks/mutations.ts uses ConvexError({ code: 'UNAUTHENTICATED' }) as the correct pattern. Member mutations should be aligned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions