[pdm-devel] applied: [PATCH datacenter-manager] server: tasks: fix filter order

Lukas Wagner l.wagner at proxmox.com
Fri Aug 22 15:21:00 CEST 2025


On Fri Aug 22, 2025 at 2:11 PM CEST, Dominik Csapak wrote:
> commit
>  bd0babf (remote tasks: add background task for task polling, use new task cache)
>
> changed the order of filters applied to the task list, namely it put the
> skip and limit at the front of the filtering, instead of the back.
>
> Since we use these paramters in the ui to batch loads, we don't want to
> first limit our numbers and then filter on them, but first apply the
> filters and then limit the amount, otherwise we could never show older
> tasks when filtered.
>
> An example:
>
> Assume the ui usess 'limit=5' to batch the loads
> if the user wants to show only those tasks with 'statusfilter=warning'
>
> but we first have 10 'OK' tasks, we'd never show anything, since the api
> would return an empty list, even if we'd have multiple warning tasks
> after that.
>
> In contrast if we filter first and then limit the number/apply the
> offset, we would get the first five tasks that ended with a warning,
> like we would expect.
>
> To fix that, move the skip/take filters at the end.
>

Oops, good catch!

Looks good to me, applied :)




More information about the pdm-devel mailing list