[Bug 43249] New: A duplicate report limit of 1 prevents users from running reports at all
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 Bug ID: 43249 Summary: A duplicate report limit of 1 prevents users from running reports at all Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com Target Milestone: --- The code that checks runnign reports checks: $running >= $duplicate_limit, but it appears a report is marked as running during prep_report Additionally Koha::Reports->running returns the reports instances, and not a count - we need to call count on the result -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41918 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41918 [Bug 41918] Prevent users from running the same report multiple times concurrently -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 203352 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203352&action=edit Bug 43249: Count the number of running reports prove -v t/db_dependent/Koha/Reports.t -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 203353 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203353&action=edit Bug 43249: Adjust unit tests The mock here says return two instances, but I don't believe it does this, when removed the tests still pass, with a limit of 1 an exception is thrown during prep report To test: 1 - Apply this 2 - prove -v t/db_dependent/Koha/Reports.t Still passes? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203352|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #3 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 203356 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203356&action=edit Bug 43249: Don't count our query against the duplicate report limit We were throwing an exception for a single run of the report when limit was as one because we were finding our query for counting the instances in the processlist, we need to skip our selves To test: 1 - Apply this patch 2 - prove -v t/db_dependent/Koha/Reports.t 3 - It fails! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #4 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 203357 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203357&action=edit Bug 43249: Update unit tests This patch restores the mock to make it seem as if one copy of the report is running, and checks that we are over the limit of 1 To test: 1 - Apply this patch 2 - prove -v t/db_dependent/Koha/Reports.t 3 - It passes! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #5 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Worth noting here, I tested with a report like: SELECT items.barcode FROM items, items items2, items items3 I set the limit to 1 If I open that in 3 tabs and click run report - they run consecutively, and I don't get an error If I open a new private browser window, sign in to Koha, and run from each window, then I get the limit So a single user could theoretically still tie up the DB by setting of a whole bunch of these in different tabs and have them running one after the other -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203353|0 |1 is obsolete| | Attachment #203356|0 |1 is obsolete| | Attachment #203357|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 203358 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203358&action=edit Bug 43249: Adjust unit tests The mock here says return two instances, but I don't believe it does this, when removed the tests still pass, with a limit of 1 an exception is thrown during prep report To test: 1 - Apply this 2 - prove -v t/db_dependent/Koha/Reports.t Still passes? Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 203359 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203359&action=edit Bug 43249: Don't count our query against the duplicate report limit We were throwing an exception for a single run of the report when limit was as one because we were finding our query for counting the instances in the processlist, we need to skip our selves To test: 1 - Apply this patch 2 - prove -v t/db_dependent/Koha/Reports.t 3 - It fails! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 203360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203360&action=edit Bug 43249: Update unit tests This patch restores the mock to make it seem as if one copy of the report is running, and checks that we are over the limit of 1 To test: 1 - Apply this patch 2 - prove -v t/db_dependent/Koha/Reports.t 3 - It passes! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43249 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org