Skip to content

Bug: organizations/delete_cleanup.ts + users/create_member.ts throw raw Error — org/user lifecycle mutations are opaque #2018

Closed

Description

@yannickmonney

Area

services/platform/convex/organizations/delete_cleanup.ts, users/create_member.ts, users/create_user_without_session.ts.

Steps to reproduce

  1. Attempt to delete an organization as a non-owner.
  2. Attempt to delete the default organization.
  3. Try to create a member who already exists in the org, or provide an already-used email.
  4. All rejections surface as opaque "Server Error".

Expected

All user-facing rejections should be ConvexError({ code: ... }) with codes like UNAUTHENTICATED, FORBIDDEN, DUPLICATE_MEMBER, etc.

Actual

organizations/delete_cleanup.ts:

  • line 30 — Unauthenticated
  • line 37 — Only owners can delete organizations
  • line 42 — The default organization cannot be deleted

users/create_member.ts:

  • line 49 — Unauthenticated
  • line 72 — Only admins can create members
  • line 123 — User is already a member of this organization
  • line 185 — Failed to create user account

users/create_user_without_session.ts:

  • line 64 — A user with this email already exists
  • line 81 — Failed to create user account

Evidence

  • services/platform/convex/organizations/delete_cleanup.ts:28-43
  • services/platform/convex/users/create_member.ts:47-73, :121-123, :183-186
  • services/platform/convex/users/create_user_without_session.ts:64-81

Notes

"User is already a member of this organization" and "A user with this email already exists" are particularly important — these are validation errors the frontend member-invite form should display inline.

Activity

  1. added
    priority: medium
    bug
    service: platform
    automated
    on Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    automatedbugpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions