Bug 1193746 - JSON collections discard extra query params when redirecting to ?page_size=20
Summary: JSON collections discard extra query params when redirecting to ?page_size=20
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: web UI
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 19.3
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-18 04:17 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-17 06:34:24 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2015-02-18 04:17:52 UTC
Description of problem:
The newer pageable JSON collection resources (for example /systems/<fqdn>/activity/, see [1]) will normally return all items in the collection if no page_size= parameter is given.

The JSON collections enforce a limit on the number of items returned: if the response would contain more than 500 items, and no page_size= parameter is given, then the request is redirected to add a page_size=20 parameter, to prevent clients from unwittingly getting back a very large response body.

However when the redirection happens it is discarding all other query parameters. Therefore if you visit a collection with a filter applied (q= parameter) but no page_size= parameter, you will be redirected to page_size=20 with the filter discarded.

[1] https://beaker-project.org/docs-release-19/server-api/http.html#pageable-json-collections

Version-Release number of selected component (if applicable):
19.2

Steps to Reproduce:
1. Request a JSON collection with more than 500 items, using a q= parameter to filter but no page_size= parameter.
For example, any Beaker system that is a few years old will typically have several thousand activity rows with the Service value of "Scheduler".
https://$BEAKER/systems/$FQDN/activity/?q=service:Scheduler

Actual results:
Redirected to the URL:
https://$BEAKER/systems/$FQDN/activity/?q=page_size=20
Filter is discarded.

Expected results:
Should be redirected to the URL:
https://$BEAKER/systems/$FQDN/activity/?q=service:Scheduler&page_size=20
showing the first 20 activity records with service Scheduler.

Comment 2 Dan Callaghan 2015-02-18 04:28:53 UTC
This doesn't affect anything in Beaker's web UI since the Backgrids always send pagination params.

Comment 3 Dan Callaghan 2015-02-18 04:46:54 UTC
http://gerrit.beaker-project.org/3993

Comment 6 Dan Callaghan 2015-03-17 06:34:24 UTC
Beaker 19.3 has been released.


Note You need to log in before you can comment on or make changes to this bug.