oar-team / oar

OAR is a versatile resource and task manager (also called a batch scheduler) for clusters and other computing infrastructures.
http://oar.imag.fr/
GNU General Public License v2.0
44 stars 23 forks source link

rest api: filters ignored for computing the "total" in /jobs or /jobs/details #199

Open mimbert opened 2 years ago

mimbert commented 2 years ago

A request such as GET /jobs?user=<USERNAME> or GET /jobs/details?user=<USERNAME> will correctly return only the jobs pertaining to the user, but in the response, the total field ignores the filter and is the total of the GET /jobs / GET /jobs/details without the ?user=<USERNAME> filter.

This makes handling pagination of responses a bit whacky, i.e: don't use the total to track the last page, instead, try to read pages until it gets an empty page. Maybe it was intended like that? or is that a bug?