-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Move filename validation out of the Router and into the FilesAdaptor #6157
Move filename validation out of the Router and into the FilesAdaptor #6157
Conversation
@mpatnode Thanks for the PR! Can you check travis and the failing tests? |
9cf3c4a
to
37be59e
Compare
Codecov Report
@@ Coverage Diff @@
## master #6157 +/- ##
==========================================
- Coverage 93.78% 93.75% -0.03%
==========================================
Files 166 166
Lines 11271 11285 +14
==========================================
+ Hits 10570 10580 +10
- Misses 701 705 +4
Continue to review full report at Codecov.
|
37be59e
to
efe12f4
Compare
That looks like some sort of race condition with the Redis config. No? |
Hall happy now. |
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.
Thanks for the PR! I added a few comments and nits. We'll review the s3 adapter PR shortly after.
src/Adapters/Files/FilesAdapter.js
Outdated
@@ -56,6 +59,37 @@ export class FilesAdapter { | |||
* @return {string} Absolute URL | |||
*/ | |||
getFileLocation(config: Config, filename: string): string {} | |||
|
|||
/** Validate a filename for this adaptor type (optional)1G |
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.
1G? I also see you are using adaptor instead of adapter. Not to nitpick but can you change it for consistency.
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.
How embarrassing
src/Adapters/Files/FilesAdapter.js
Outdated
* | ||
* @param {string} filename | ||
* | ||
* @returns {null|*|Parse.Error} null if there are no errors |
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.
@returns {null|Parse.Error} What does asterisk mean?
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.
Intellij being over-zealous
src/Adapters/Files/FilesAdapter.js
Outdated
'Filename contains invalid characters.' | ||
); | ||
} | ||
return null; // No errors |
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.
Remove the comment.
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.
👍
@dplewis Process question: Do you prefer we squash when addressing PR issues, or wait till all review is complete? |
Good Job! There are 2 failing tests on travis, after that we will squash and merge this PR. |
Yeah, remembered that was going to fail after I walked away. |
postgres 😿 |
@mpatnode I can pull this down and look into it |
I think it's just a race condition in the test suite. Is it being ran randomized? |
…arse-community#6157) * Move filename validation out of the Router and into the FilesAdaptor * Address PR comments * Update unittests to handle FilesAdapter interface change * Make validateFilename optional
Didn't seem to make sense to me that the router would be deciding the syntax of my filenames. Specifically, I wanted to be able to create "directories" in AWS, and the router was rejecting the '/' character. Note, there is no behavior change in this code WRT how / is treated in a filename, because there is no AWS code here. That's a decision for the FilesAdaptor