Skip to content

Hotfix: Thang Editor raster upload fails with 422 - #8469

Merged
Bryukh merged 1 commit into
masterfrom
hf-thang-editor-raster-upload-422
Sep 17, 2026
Merged

Bryukh merged 1 commit into
masterfrom
hf-thang-editor-raster-upload-422

Conversation

@Bryukh

@Bryukh Bryukh commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

Uploading a raster image or animation sheet in the Thang Editor fails: POST /file returns 422 and the editor shows "Raster upload failed".

Cause

saveRasterFile uploads through core/api/files saveFile, which sends a JSON body. It passed force: true, so the server received a boolean. The POST /file schema types force as a string, so validation rejects the request.

Callers that post with $.ajax are form-encoded, so their true arrives as the string "true" and passes. The other saveFile callers (FilesComponent.vue, ModalRosterClassrooms.vue) already send 'true'.

Fix

Send force: 'true' from saveRasterFile. 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

  • Bug Fixes
    • Fixed raster file saving so forced saves are accepted successfully instead of failing validation.
    • Improved compatibility with the file upload process when replacing existing files.

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>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2e33bd0c-ecdc-44ff-8899-46dbca859189

📥 Commits

Reviewing files that changed from the base of the PR and between ade9746 and 70f9b61.

📒 Files selected for processing (1)
  • app/views/editor/thang/ThangTypeEditView.js

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

saveRasterFile now sends the force option as the string 'true' instead of the boolean true. This matches the POST /file schema and prevents a 422 validation response.

Changes

Raster save validation

Layer / File(s) Summary
Overwrite flag request
app/views/editor/thang/ThangTypeEditView.js
saveRasterFile passes force: 'true' to saveFile, matching the server schema.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 70f9b

The overwrite flag now matches the server contract, with no unresolved merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the hotfix for the Thang Editor raster upload 422 error, which is the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hf-thang-editor-raster-upload-422

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Bryukh Bryukh self-assigned this Sep 17, 2026
@Bryukh
Bryukh merged commit e893791 into master Sep 17, 2026
3 checks passed
@Bryukh
Bryukh deleted the hf-thang-editor-raster-upload-422 branch September 17, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant