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.
feat: Allow File adapter to create file with specific locations or dynamic filenames #9557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: alpha
Are you sure you want to change the base?
feat: Allow File adapter to create file with specific locations or dynamic filenames #9557
Changes from all commits
dc4a2371793ac3638e9900084ce4090f858bfc413a711930daf4cf36e13f023e23193b0b3084ca1f4944f9985bace562cf696c2116908e00715ea9bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locationin the return type is never consumed and ambiguous vs.urlThe documented return shape has both
urlandlocation, butFilesRouter(Context Snippet 4) only readscreateFileResult.urlandcreateFileResult.name. An adapter that returns{ location: 'https://…' }instead of{ url: 'https://…' }will silently produce an undefined URL for the stored file.Either drop the
locationfield from the documented return type, or (if it's intentional as an alias) document exactly how the controller will resolve precedence betweenurlandlocation, and ensure the controller code actually implements that resolution.📝 Proposed fix
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: parse-community/parse-server
Length of output: 213
FilesController.createFilemust passconfigto the adapter and use its return valueThe adapter interface documents that
configis forwarded as a 5th parameter and that an adapter may return{url, name}to override defaults. However,src/Controllers/FilesController.js:49currently calls the adapter without passingconfigand discards its return value:This means:
undefinedforconfig, causing any internalgetFileLocationcall to fail.Update the controller to pass
configand consume the adapter's response:Proposed fix
🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.