fix: return 422 instead of 500 for non-versionable labelled version requests - #308
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…equests POST /versionsource on a binary file (jpg/png/pdf/etc) can never create a version by design (COR-46/COR-55, #288) — but the rejection returned 500, misclassifying an expected, non-retryable outcome as a server error. A bulk media migration hammering this endpoint on ~1200 assets showed up as a 500 spike in ClickHouse, when nothing was actually broken. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
kptdobe
force-pushed
the
fix/versionsource-422-non-versionable
branch
from
August 3, 2026 12:42
46c384f to
1f5f582
Compare
Collaborator
|
🎉 This PR is included in version 1.13.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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
POST /versionsourceon a binary file (jpg/png/pdf/etc) can never create a version by design (shouldCreateVersiongates to html/json only, see fix(version): heal ContentType for legacy octet-stream files on labelled version #288). The rejection returned 500, misclassifying an expected, non-retryable outcome as a server error.console.errortoconsole.warnto match.Test plan
test/storage/version/put.test.jsregression test to assert 422 (verified it failed against the old 500 behavior first)npm test— 479 passingnpm run lint— clean