-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add maxLimit server configuration #4048
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
Conversation
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.
One small change for the test otherwise that’s a great addition!
src/Config.js
Outdated
@@ -220,6 +224,14 @@ export class Config { | |||
} | |||
} | |||
|
|||
static validateMaxLimit(maxLimit) { | |||
if (maxLimit) { |
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.
Can you add a test with server configured with maxLimit: 0? This will probably not throw as not goin in.
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.
Great catch - I've updated the tests and code accordingly. lint also pointed out some spacing inconsistencies in files unrelated to my change so I updated those files too.
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.
Actually I reverted the indentation updates as they were triggered by a new version of eslint. The CI servers don't have that version yet so builds of my last set of changes were failing.
Codecov Report
@@ Coverage Diff @@
## master #4048 +/- ##
==========================================
+ Coverage 92.08% 92.12% +0.03%
==========================================
Files 116 116
Lines 7960 7974 +14
==========================================
+ Hits 7330 7346 +16
+ Misses 630 628 -2
Continue to review full report at Codecov.
|
I found that eslint 4.3.0 has made a non-backward-compatible change to its indent rules logic and rejects code in the latest master of parse-server. It looks like 4.3.0 hasn't made it to the CI servers yet so I downgraded my local version to 4.2.0 to allow tests to pass for me locally. I've not modified package.json so you can expect parse-server builds to fail when npm install pulls in 4.3.0 |
@flovilmart - requested changes have been made, ready for re-review whenever you have time - thanks! |
@copterchris I updated the branch to match with master, waiting for the tests to run and merging. |
Adding an optional server configuration parameter 'maxLimit' to specify the maximum number of records that can be retrieved in a single request. When specified, any attempt to specify a limit greater than the configured number will result in that limit being silently replaced by the configured maximum (i.e the request will not be rejected, but will be limited to the configured maximum).