Bug 37905 - Correctly fix the "last hour" filter on the job list
Summary: Correctly fix the "last hour" filter on the job list
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 37902 36217
Blocks: 37888
  Show dependency treegraph
 
Reported: 2024-09-12 12:49 UTC by Jonathan Druart
Modified: 2024-11-19 15:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function:


Attachments
Revert "Bug 36217: Fix background jobs page's include_last_hour filter" (8.09 KB, patch)
2024-09-12 12:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37905: Use the server's tz to limit the jobs by "enqueued in the last hour" (2.02 KB, patch)
2024-09-12 12:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37905: Fix parameter name (1.12 KB, patch)
2024-09-12 12:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37905: Use correct RFC3339 formatted date to the server (1.58 KB, patch)
2024-09-12 14:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 37905: Fix parameter name (1.13 KB, patch)
2024-09-12 14:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Revert "Bug 36217: Fix background jobs page's include_last_hour filter" (8.14 KB, patch)
2024-09-19 13:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37905: Use correct RFC3339 formatted date to the server (1.64 KB, patch)
2024-09-19 13:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37905: Fix parameter name (1.18 KB, patch)
2024-09-19 13:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Revert "Bug 36217: Fix background jobs page's include_last_hour filter" (8.21 KB, patch)
2024-10-17 15:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37905: Use correct RFC3339 formatted date to the server (1.70 KB, patch)
2024-10-17 15:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37905: Fix parameter name (1.25 KB, patch)
2024-10-17 15:14 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2024-09-12 12:49:12 UTC
See bug 36217 for more info, and especially the last comments. We want to revert what has been pushed and fix it properly with 2 lines of JS.
Comment 1 Jonathan Druart 2024-09-12 12:53:51 UTC
Created attachment 171386 [details] [review]
Revert "Bug 36217: Fix background jobs page's include_last_hour filter"

This reverts commit f5c839348091d129bb7100af2c9e64e486d0ea1d.
Comment 2 Jonathan Druart 2024-09-12 12:53:54 UTC
Created attachment 171387 [details] [review]
Bug 37905: Use the server's tz to limit the jobs by "enqueued in the last hour"

This patch suggests to revert the previous attempt to fix this problem.
The date was using the client-side's tz and so the "last hour" was not
matching the one from the server.

I have noticed a couple of things when working on this:
* We cannot pass a RFC3339 formatted date to the server (will open a
  separate bug report)
* toISOString() and the handling of timezone in dayjs is ambiguous or
  buggy
https://github.com/iamkun/dayjs/issues/2720
https://github.com/iamkun/dayjs/issues/2611

With bug 37831 with simply need to pass a rfc3339-formatted date and the
filtering will be done as expected.
Comment 3 Jonathan Druart 2024-09-12 12:53:56 UTC
Created attachment 171388 [details] [review]
Bug 37905: Fix parameter name

It's named enqueued_date on the API side, not enqueued_on (which is the DB
column's name)

No behaviour change expected here.
Comment 4 Jonathan Druart 2024-09-12 14:37:33 UTC
Created attachment 171404 [details] [review]
Bug 37905: Use correct RFC3339 formatted date to the server

This patch suggests to revert the previous attempt to fix this problem.
The date was using the client-side's tz and so the "last hour" was not
matching the one from the server.

With bug 37831 with simply need to pass a rfc3339-formatted date and the
filtering will be done as expected.
Comment 5 Jonathan Druart 2024-09-12 14:37:35 UTC
Created attachment 171405 [details] [review]
Bug 37905: Fix parameter name

It's named enqueued_date on the API side, not enqueued_on (which is the DB
column's name)

No behaviour change expected here.
Comment 6 Nick Clemens (kidclamp) 2024-09-19 13:43:39 UTC
Created attachment 171759 [details] [review]
Revert "Bug 36217: Fix background jobs page's include_last_hour filter"

This reverts commit f5c839348091d129bb7100af2c9e64e486d0ea1d.

https://bugs.koha-community.org/show_bug.cgi?id=37905
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens (kidclamp) 2024-09-19 13:43:41 UTC
Created attachment 171760 [details] [review]
Bug 37905: Use correct RFC3339 formatted date to the server

This patch suggests to revert the previous attempt to fix this problem.
The date was using the client-side's tz and so the "last hour" was not
matching the one from the server.

With bug 37831 with simply need to pass a rfc3339-formatted date and the
filtering will be done as expected.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens (kidclamp) 2024-09-19 13:43:43 UTC
Created attachment 171761 [details] [review]
Bug 37905: Fix parameter name

It's named enqueued_date on the API side, not enqueued_on (which is the DB
column's name)

No behaviour change expected here.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens (kidclamp) 2024-09-19 13:46:23 UTC
All works on top of 37902 - filtering as expected
Comment 10 Martin Renvoize (ashimema) 2024-10-17 15:14:46 UTC
Created attachment 172902 [details] [review]
Revert "Bug 36217: Fix background jobs page's include_last_hour filter"

This reverts commit f5c839348091d129bb7100af2c9e64e486d0ea1d.

https://bugs.koha-community.org/show_bug.cgi?id=37905
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize (ashimema) 2024-10-17 15:14:48 UTC
Created attachment 172903 [details] [review]
Bug 37905: Use correct RFC3339 formatted date to the server

This patch suggests to revert the previous attempt to fix this problem.
The date was using the client-side's tz and so the "last hour" was not
matching the one from the server.

With bug 37831 with simply need to pass a rfc3339-formatted date and the
filtering will be done as expected.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize (ashimema) 2024-10-17 15:14:51 UTC
Created attachment 172904 [details] [review]
Bug 37905: Fix parameter name

It's named enqueued_date on the API side, not enqueued_on (which is the DB
column's name)

No behaviour change expected here.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize (ashimema) 2024-10-17 15:15:19 UTC
So glad to see this one through.. working great and considerably cleaner.

Passing QA.. thanks Jonathan!
Comment 14 Katrin Fischer 2024-10-18 12:27:38 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 15 Lucas Gass (lukeg) 2024-11-19 15:57:42 UTC
Backported to 24.05.x for upcoming 24.05.06