Repository navigation
Conversation
Project uploads sent the raw filename, which multer reads as latin1 and the upload route then decodes with decodeURIComponent. Non-ASCII names were garbled, a stray percent sign failed with a 400, and a valid escape such as %20 was silently rewritten. Percent-encode the name the same way chat uploads do.
berry-13
marked this pull request as ready for review
November 7, 2026 00:09
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
Pull Request
Summary
Uploading a file from the Projects files pane garbles any filename outside ASCII:
Описание.mdis stored asÐпиÑание.md, and the RAG API and the file row both receive the broken name. A name with a stray percent sign such as100% done.mdis rejected with a 400, and a name containing a valid escape such asa%20b.mdis silently rewritten.The upload route decodes every filename with
decodeURIComponent, and multer reads a raw multipart filename as latin1, so the client has to percent-encode the name. Chat uploads do since #12977; this upload never did. It now sends the encoded name, so these files keep their names. Files already stored with a garbled name stay that way until they are uploaded again.Related to #17733
Type of change
Testing
Tested environments/configuration:
fetch.Automated tests:
ProjectResources.spec.tsx: added a case each for Cyrillic, Japanese,100% done.mdanda%20b.md. All four failed before the fix; the full spec now passes 18 of 18.project-files-ui.spec.ts: added scenarios that check the stored name after a reload for a non-Latin name and a percent-sign name. Both, plus the existing association retry scenario, passed in desktop light, desktop dark and mobile.Screenshots / recordings
No layout change: the file row shows the correct filename instead of a garbled one.
Risk / compatibility
None. Plain ASCII names encode to themselves, and the server already decodes this form for chat uploads.
Checklist