You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/05/20 19:59:55 UTC

[GitHub] [couchdb] iilyak opened a new pull request #2896: Fix handling of limit query parameter

iilyak opened a new pull request #2896:
URL: https://github.com/apache/couchdb/pull/2896


   ## Overview
   
   This PR fixes a one off problem when limit is given in query parameter and it's value is less than page_size.
   
   ## Testing recommendations
   
   ```
   make eunit apps=couch_views tests=check_completion_test
   make exunit tests=src/chttpd/test/exunit/pagination_test.exs
   ```
   
   ## Related Issues or Pull Requests
   
   * fixes https://github.com/apache/couchdb/pull/2870
   
   ## Checklist
   
   - [x] Code is written and works correctly
   - [x] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] iilyak commented on a change in pull request #2896: Fix handling of limit query parameter

Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #2896:
URL: https://github.com/apache/couchdb/pull/2896#discussion_r428274049



##########
File path: src/couch_views/src/couch_views_http.erl
##########
@@ -108,7 +108,7 @@ paginated_cb({meta, Meta}, #vacc{}=VAcc) ->
 paginated(Req, EtagTerm, #mrargs{page_size = PageSize} = Args, KeyFun, Fun) ->
     Etag = couch_httpd:make_etag(EtagTerm),
     chttpd:etag_respond(Req, Etag, fun() ->
-        hd(do_paginated(PageSize, [set_limit(Args)], KeyFun, Fun))
+        hd(do_paginated(PageSize, [Args], KeyFun, Fun))

Review comment:
       For curious reviewer we were setting limit here and then increment it again on line 127.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] iilyak merged pull request #2896: Fix handling of limit query parameter

Posted by GitBox <gi...@apache.org>.
iilyak merged pull request #2896:
URL: https://github.com/apache/couchdb/pull/2896


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org