Repository navigation
fix(cases): show the real reason when Link Existing rejects a case - #590
Open
opticon454 wants to merge 1 commit into
Open
opticon454 wants to merge 1 commit into
opticon454 wants to merge 1 commit into
Conversation
POST /api/cases/link passed a fixed 'Invalid request body' to parseBody, which replaced the schema's own message, so a bad name and a bad folder path (a leading ~, a character a session working directory cannot have) looked the same. Drop the override so the first validation issue is returned.
opticon454
force-pushed
the
fix/case-link-validation-message
branch
from
October 10, 2026 06:15
5b6337a to
0ae6795
Compare
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.
Problem
Add Case → Link Existing answers every validation failure with "Invalid request body".
POST /api/cases/linkpasses that fixed string toparseBody, which uses it instead of the schema's message, so a bad case name, a path starting with~(the route expands~later, but the absolute-path rule rejects it first) and a path with a character a session folder cannot have all read the same, with nothing to act on.Change
Drop the override, so the first validation issue is returned: "Invalid case name format" or "Invalid path: must be absolute, no shell metacharacters or traversal".
Tests
test/routes/case-routes.test.ts: a bad name and a~/…path each return their own message. The file passes (44),tsc --noEmitclean.