[Bug 44093] New: Notices management: avoid rendering hidden frame and queries for every listed notice
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44093 Bug ID: 44093 Summary: Notices management: avoid rendering hidden frame and queries for every listed notice Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: martin.renvoize@openfifth.co.uk Depends on: 33260 Target Milestone: --- Follow-up to bug 33260, reported by Pedro Amorim. Notices management does potentially heavy work for every listed notice on each load. Each listed notice renders a hidden frame with its full content, and runs its own queries for its patron and its notice template. With up to 1000 notices listed, that is up to 1000 hidden frames and over a thousand extra queries per page load. The content, patron and template lookups should be done lazily (only when a notice is previewed) or prefetched in bulk. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33260 [Bug 33260] Show message queue on staff interface and make notices printable -- 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=44093 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211743 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211743&action=edit Bug 44093: Do not render every notice of Notices management on each load Each notice listed in Notices management rendered a hidden frame with its full content, and ran its own queries for its patron, the category of the patron, and its notice template. With up to 1000 notices listed, that is up to 1000 hidden frames and over a thousand extra queries on each load. * The content of a notice is no longer in the list. It is loaded when the notice is opened, from a new 'content' action of tools/notices.pl. It gives the content as JSON, which the browser does not show as a page, as the content of a notice must not run in the page, and it is shown in the same frame that cannot run anything. The notices that cannot be seen by the user are not found, and the permission is the one of the page * The patrons of the notices, and their category, are fetched with the notices, not one by one. The notice template was only needed for the content For 300 notices, a load of the page went from 655 to 54 queries. To test: 1. Set 'NoticesManagement' to 'Enable' and queue some notices, for example by sending welcome notices to patrons that have an email address and running perl misc/cronjobs/process_message_queue.pl 2. Go to More > Tools > Notices management 3. Confirm the notices are listed and, in the page source, there is no hidden frame and no content for each of them 4. Click the subject of a notice: it is shown in a frame, as before, and the Resend, Print and Convert to print buttons work as before 5. Click the subject of a PASSWORD_RESET notice: its content is not displayed 6. To see the queries, with 300 or more notices, compare the number of queries of a load with and without the patch (for example with the Questions of 'SHOW GLOBAL STATUS' of the database, before and after a load of the page) 7. Run: yarn cypress run --spec t/cypress/integration/Tools/NoticesManagement_spec.ts Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- 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=44093 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |44092 Status|NEW |Needs Signoff Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44092 [Bug 44092] Notices management: do not offer 'Resend' for notices without a patron -- 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=44093 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|33260 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33260 [Bug 33260] Show message queue on staff interface and make notices printable -- 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=44093 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=44093 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Notices |Architecture, internals, | |and plumbing -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org