Skip to content

Bug: thread share/fork/branch mutations throw raw Error — all user-facing rejections are opaque Server Errors #2007

Description

@yannickmonney

Area

services/platform/convex/threads/share_thread.ts, threads/fork_thread.ts, threads/fork_own_thread.ts, threads/create_branch_thread.ts, threads/mutations.ts.

Steps to reproduce

  1. Attempt to share a thread that is archived, an arena thread, or a branch thread.
  2. Attempt to fork a shared thread with an invalid token or as a non-member of the owning org.
  3. Attempt to branch/create-arena on a thread you do not own.
  4. Any rejection surfaces as an opaque "Server Error" in the client console.

Expected

All user-facing conditions should throw ConvexError({ code: ... }) so the UI can render actionable error messages.

Actual

Raw new Error(string) throws in all public thread mutation handlers:

  • share_thread.ts:15 — Unauthenticated
  • share_thread.ts:24 — Thread not found
  • share_thread.ts:28 — Not authorized to share this thread
  • share_thread.ts:32 — Cannot share an archived thread
  • share_thread.ts:36 — Cannot share arena mode threads
  • share_thread.ts:40 — Cannot share branch threads
  • share_thread.ts:78-95unshareThread: Unauthenticated, Thread not found, Not authorized
  • fork_thread.ts:22 — Unauthenticated
  • fork_thread.ts:26 — Invalid share token
  • fork_thread.ts:35/46 — Shared thread not found (org membership gate)
  • fork_own_thread.ts:19 — Unauthenticated
  • fork_own_thread.ts:28 — Thread not found
  • fork_own_thread.ts:33 — Not authorized to fork this thread
  • create_branch_thread.ts:33 — Source thread not found
  • create_branch_thread.ts:37 — Not authorized to branch this thread
  • threads/mutations.ts:116-123 — Thread not found (createArenaThread)

Evidence

  • services/platform/convex/threads/share_thread.ts:15-40 and :78-95
  • services/platform/convex/threads/fork_thread.ts:22-46
  • services/platform/convex/threads/fork_own_thread.ts:19-33
  • services/platform/convex/threads/create_branch_thread.ts:33-37
  • services/platform/convex/threads/mutations.ts:116-123

Notes

tasks/mutations.ts uses ConvexError({ code: 'UNAUTHENTICATED' }) etc. as the established pattern for this codebase.

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