kimai / Paid-plugins

Support for paid Kimai plugins: Discussions and feature requests
https://www.kimai.org/store/
11 stars 1 forks source link

Tasks API queries returning contents of last page for non existent pages #97

Closed pbksol closed 1 year ago

pbksol commented 1 year ago

Old behaviour: /api/tasks returned an empty or 404 result if a page was requested that did not exists New behaviour: If you request a page way out of range always the contents of the last existing page is returned

To simplify things, here's a sample request for demo.kimai:

Real last page Requesting page 300

This is currently killing all Task API stuff :-( We fixed it temporarily by comparing the returned data with the previous page so take your time :-)

kevinpapst commented 1 year ago

True. Expenses as well, unfortunately.

I fixed https://github.com/kimai/kimai/issues/4279 in https://github.com/kimai/kimai/pull/4273/files but forgot to adapt the plugins that have an API.

Fix is on the way, I'll update here later.

kevinpapst commented 1 year ago

Uploaded new versions to Lemonsqueezy, can you please retry!?

pbksol commented 1 year ago

I checked with Tasks and Expenses and empty pages return a 404 as expected again.

Thanks for the quick fix. I know that obviously nobody else is using the API. Many kudos for maintaining it nonetheless. The API and the possibility to make it sync with other systems is one important reason why Kimai is used.

kevinpapst commented 1 year ago

Yeah, I am really not sure if the Task API is heavily used. But an API belongs to every plugin, at least if it is requested by one person.

I think every software should be able to be queried from the outside world.