You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Backend raw Errors leave the client with no actionable message — chat approval/human-input cards, knowledge-entry duplicate toast, automations-trigger dialogs #2056
Area / route
Three features where the backend throws a raw new Error (redacted to a generic 'Server Error' in production) AND the client either swallows it or maps it via a fragile error.message.includes(...) check — so the user gets a generic/opaque failure instead of the specific localized reason the code intends. Each is the same class as #1993 (which only covers website/customer/vendor duplicate-add) but a distinct surface with its own client-mapping fix. Preserved below.
Evidence: approvals/mutations.ts:25 (throw new Error('Unauthenticated')), :30 (throw new Error('Approval not found')); approvals/helpers.ts:333-340 (raw Error FSM messages); agent_tools/human_input/actions.ts:31 (throw new Error('Unauthenticated')); surfaced raw at integration-approval-card.tsx:117/138 and human-input-request-card.tsx:257/352 (err instanceof Error ? err.message : ...)
[69] Knowledge-entry duplicate-topic toast branch is dead in production (backend throws raw Error, message redacted by Convex)
Evidence: mutations.ts:52-56 and :115-119 (throw new Error('... already exists')); knowledge-entry-add-dialog.tsx:80-88 and knowledge-entry-edit-dialog.tsx:79-89 (branch on error.message.includes('already exists'))
[88] automations-trigger slug_mutations throw raw Error instead of ConvexError — validation/auth/duplicate reasons are scrubbed to a generic toast and never reach the user
Evidence: slug_mutations.ts:52,55,86,116,137,160,163,196,221 (raw throw new Error(...) for auth/validation), :315-318 (duplicate-subscription raw Error); client swallow at event-create-dialog.tsx:170-174 and schedule-create-dialog.tsx:231-235 → tCommon('errors.generic')
Notes
Each needs two halves: (a) convert the backend throws to ConvexError({ code }) with stable codes; (b) fix the client to map the code (errorCode()/convexErrorCode/readConvexErrorData) instead of swallowing or string-matching. [30]: integration-approval-card.tsx + human-input-request-card.tsx need an errorCode() mapper (plan/human-control cards already have one); codes UNAUTHENTICATED/NOT_FOUND/ALREADY_RESOLVED + human-input-specific. [69]: knowledge_entries mutations + add/edit dialogs (the same fragile includes('already exists') also exists in website-add-dialog.tsx). [88]: slug_mutations.ts (UNAUTHENTICATED/INVALID_SLUG/NOT_INSTALLED/APP_OWNED_WORKFLOW/INVALID_EVENT_TYPE/NOT_FOUND/DUPLICATE_SUBSCRIPTION) + bind the error in the two trigger dialogs' bare catch. Add per-module regression tests asserting a ConvexError carrying the code. Distinct from the pure-standardization sweep (07/09/51/58/84) which has no extra client-mapping defect, and from [62]/[99]/[111]/[08] (filed separately for their own additional defects).
Filed by an automated manual-review pass (live browser QA + a 25-agent code-grounded audit, each finding adversarially verified). Deduped against open issues (incl. #1972–#1999, settings/forms epic #1941–#1966, audit cluster #1842–#1846) and recently-closed issues.
Activity
fix(platform): map raw backend errors to ConvexError codes for action…
fix(platform): throw ConvexError for customer and vendor duplicate-add (