fix: use ConvexError for client-facing publish errors#187
Merged
juhgiyo merged 1 commit intoApr 10, 2026
Conversation
Convex strips plain Error messages from client-facing mutations as a security feature. The improved error messages from PR #186 were invisible to web UI users because throwIfDepErrors and the publish mutation used throw new Error(). Changed to throw new ConvexError() so messages pass through to the client. The CLI path (httpAction -> publishInternal) is unaffected since httpAction catches e.message which works for both types. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
juhgiyo
added a commit
that referenced
this pull request
Apr 11, 2026
… errors Convex strips plain Error messages from client-facing mutations as a security feature — only ConvexError passes through to the web UI client. This change mirrors PR #187's fix for roles.ts: - Add ConvexError import from convex/values - Add throwIfDepErrors helper with actionable messages (includes skill slug, missing dependency names, and fix suggestions) - Change all throw new Error() to throw new ConvexError() in the client-facing publish mutation (auth, ownership, deletion, version, dependency errors) - Leave publishInternal and other internal mutations unchanged Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 tasks
juhgiyo
added a commit
that referenced
this pull request
Apr 12, 2026
…tations Apply the same Error → ConvexError fix from PR #187 (roles.ts) and PR #188 (skills.ts) to the remaining three entity files. In each client-facing publish mutation, all throw new Error() statements are replaced with throw new ConvexError() so error messages pass through to the web UI instead of being stripped by Convex's security layer. Version error messages now include the entity slug for easier debugging. publishInternal mutations are intentionally left unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 tasks
juhgiyo
added a commit
that referenced
this pull request
Apr 13, 2026
…rors (#188) ## Summary - Apply the same Error → ConvexError fix from PR #187 (roles.ts) to convex/skills.ts - Add throwIfDepErrors helper with actionable messages (skill slug, missing dep names, fix suggestion) - Convert 7 throw statements in the client-facing publish mutation from Error to ConvexError - publishInternal left unchanged (httpAction catches e.message) Fixes the same Convex security behavior where plain Error messages are stripped from client-facing mutations — web UI users saw generic "Server Error" instead of the actual error text. ## Test plan - [x] All 266 existing tests pass - [x] TypeScript compiles cleanly - [x] Code review: NO_FURTHER_IMPROVEMENTS - [x] Code simplifier: NO_FURTHER_IMPROVEMENTS - [x] QA verification: all 9 acceptance criteria pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
juhgiyo
added a commit
that referenced
this pull request
Apr 13, 2026
#189) ## Summary - Apply the same Error → ConvexError fix from PR #187 (roles.ts) and PR #188 (skills.ts) to the remaining 3 files - Convert 7 throw statements per file (21 total) in client-facing publish mutations from Error to ConvexError - Enhanced version error messages to include entity slug for better debugging context - publishInternal mutations left unchanged (httpAction catches e.message) - No throwIfDepErrors helper needed (these entities have no dependency validation) Completes the Error → ConvexError migration across all 5 publish mutations: roles.ts (#187), skills.ts (#188), agents.ts + integrations.ts + memories.ts (this PR). ## Test plan - [x] All 266 existing tests pass - [x] TypeScript compiles cleanly - [x] Code review: NO_FURTHER_IMPROVEMENTS - [x] Code simplifier: NO_FURTHER_IMPROVEMENTS - [x] QA verification: all 9 acceptance criteria pass (verified per-file) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Errormessages from client-facing mutations as a security feature, so the improved error messages from PR fix: improve publish dependency error messages #186 were invisible to web UI users (they saw generic "Server Error" instead)throw new Error()→throw new ConvexError()inconvex/roles.ts: thethrowIfDepErrorshelper and all error throws in thepublishmutation (auth, ownership, deletion, version checks)publishInternal(internal mutation) left unchanged — its errors are caught by the httpAction which accessese.messagedirectlyTest plan
tsc --noEmit)ConvexError(string).message === string(httpAction catch blocks still work)Follow-up (out of scope)
softDeleteandrestoremutations inconvex/roles.tshave the same bug (plainErrorin client-facing mutations)convex/skills.ts,convex/agents.ts,convex/integrations.ts,convex/memories.tshave the same pattern🤖 Generated with Claude Code