Skip to content

Bug: folders/mutations.ts — all CRUD operations throw raw Error instead of ConvexError #2005

Description

@yannickmonney

Area

services/platform/convex/folders/mutations.tscreateFolder, renameFolder, moveFolder, reassignFolderTeam mutations.

Steps to reproduce

  1. Try to create a folder with an empty name, too-long name, duplicate name, or into a team you do not belong to.
  2. Any error is surfaced to the client as an opaque "Server Error" rather than a structured ConvexError.

Expected

User-facing validation and permission errors (empty name, duplicate, max depth, team mismatch, unauthenticated, access denied) are thrown as ConvexError({ code: ... }) so the frontend can render them as structured toast/inline errors.

Actual

Every error path in all four folder mutations throws new Error(string):

  • Auth check, parent-not-found, parent-not-accessible, max-depth, team-not-member, duplicate-name, folder-not-found, access-denied, invalid-name variants all use raw Error.

Evidence

  • services/platform/convex/folders/mutations.ts:130-141validateFolderName() (called in all mutations)
  • services/platform/convex/folders/mutations.ts:162 — duplicate name check
  • services/platform/convex/folders/mutations.ts:177-220createFolder handler (Unauthenticated, Parent folder not found, Parent folder not accessible, Maximum folder nesting depth exceeded, Cannot create folder in a team you do not belong to)
  • services/platform/convex/folders/mutations.ts:250-270renameFolder (Unauthenticated, Folder not found, Access denied)
  • services/platform/convex/folders/mutations.ts:296-315deleteFolder (Unauthenticated, Folder not found, Access denied)
  • services/platform/convex/folders/mutations.ts:353-386reassignFolderTeam (Unauthenticated, Folder not found, Cannot change team, Access denied, Cannot assign folder to a team you do not belong to)

Notes

tasks/mutations.ts and tasks/review_mutations.ts already use ConvexError({ code: ... }) as the correct pattern. Folder mutations should follow the same convention.

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