Hotfix: Thang Editor raster upload fails with 422 - #8469
Conversation
saveRasterFile posts JSON through core/api/files saveFile, so `force: true` reached POST /file as a boolean. The server schema types `force` as a string and rejects the body with 422. Send 'true' like the other saveFile callers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesRaster save validation
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The overwrite flag now matches the server contract, with no unresolved merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
Uploading a raster image or animation sheet in the Thang Editor fails:
POST /filereturns 422 and the editor shows "Raster upload failed".Cause
saveRasterFileuploads throughcore/api/filessaveFile, which sends a JSON body. It passedforce: true, so the server received a boolean. ThePOST /fileschema typesforceas a string, so validation rejects the request.Callers that post with
$.ajaxare form-encoded, so theirtruearrives as the string"true"and passes. The othersaveFilecallers (FilesComponent.vue,ModalRosterClassrooms.vue) already send'true'.Fix
Send
force: 'true'fromsaveRasterFile. One line, client only.Testing
Verified locally: raster image upload in the Thang Editor succeeds with the change.
🤖 Generated with Claude Code
Summary by CodeRabbit