[Bug 41039] New: Patron search button can be spammed and trigger many API patron searches
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Bug ID: 41039 Summary: Patron search button can be spammed and trigger many API patron searches Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Every click of the "Search" button on members/members-home.pl will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. -- 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=41039 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=41039 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188063 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188063&action=edit Bug 41039: Prevent patron search button from being spammed triggering multiple api requests Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching, will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. Test Plan: 1) Browse to members-home.pl 2) Open the network tab of the developer console on your web browser 3) Double click the Search button 4) Note the two api requests in the network tab 5) Apply this patch 6) Reload the page 7) Double click the Search button 8) Note only one api request is made If your results come back too fast, you may perform an initial search, then change the number of results from the default 20 to "All" to create a search that will take longer. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Kristi Krueger <kkrueger@cuyahogalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkrueger@cuyahogalibrary.or | |g -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Daniel B. <dbarden@cuyahogalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dbarden@cuyahogalibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41048 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 [Bug 41048] Add ability to disallow empty patron searches -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Keywords| |RM_priority -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.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=41039 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188063|0 |1 is obsolete| | --- Comment #2 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Created attachment 188123 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188123&action=edit Bug 41039: Prevent patron search button from being spammed triggering multiple api requests Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching, will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. Test Plan: 1) Browse to members-home.pl 2) Open the network tab of the developer console on your web browser 3) Double click the Search button 4) Note the two api requests in the network tab 5) Apply this patch 6) Reload the page 7) Double click the Search button 8) Note only one api request is made If your results come back too fast, you may perform an initial search, then change the number of results from the default 20 to "All" to create a search that will take longer. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #3 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I needed to put it in "Need Signoff" to then go to "Signed off". Sorry! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Shouldn't we use preventDoubleFormSubmit here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #4)
Shouldn't we use preventDoubleFormSubmit here?
I don't think that code works here because this is an ajax based search, so the doesn't reload after results are returned. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Kyle M Hall (khall) from comment #5)
(In reply to Jonathan Druart from comment #4)
Shouldn't we use preventDoubleFormSubmit here?
I don't think that code works here because this is an ajax based search, so the doesn't reload after results are returned.
Indeed sorry, silly idea. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Test plan doesn't include tests for other places like http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=29 but it does appear to work there too -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188123|0 |1 is obsolete| | --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Created attachment 188191 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188191&action=edit Bug 41039: Prevent patron search button from being spammed triggering multiple api requests Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching, will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. Test Plan: 1) Browse to members-home.pl 2) Open the network tab of the developer console on your web browser 3) Double click the Search button 4) Note the two api requests in the network tab 5) Apply this patch 6) Reload the page 7) Double click the Search button 8) Note only one api request is made If your results come back too fast, you may perform an initial search, then change the number of results from the default 20 to "All" to create a search that will take longer. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- We need Cypress or Selenium tests here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #9)
We need Cypress or Selenium tests here.
Yeah, that thought crossed my mind. You're right. I wonder how best do that in this case. Wondering if we need to mock an endpoint to produce a delayed response so we can detect the disabled button? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #10)
(In reply to Jonathan Druart from comment #9)
We need Cypress or Selenium tests here.
Yeah, that thought crossed my mind. You're right. I wonder how best do that in this case. Wondering if we need to mock an endpoint to produce a delayed response so we can detect the disabled button?
I would try the easy way: Click "search", wait for the button to be disabled, then wait for the button to be enabled, then eventually click "search" again. Cypress is fast and the button should be disabled before we get the response. Run it in a loop to make sure it won't fail randomly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #12 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 189031 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189031&action=edit Bug 41039: Prevent patron search button from being spammed triggering multiple api requests Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching, will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. Test Plan: 1) Browse to members-home.pl 2) Open the network tab of the developer console on your web browser 3) Double click the Search button 4) Note the two api requests in the network tab 5) Apply this patch 6) Reload the page 7) Double click the Search button 8) Note only one api request is made If your results come back too fast, you may perform an initial search, then change the number of results from the default 20 to "All" to create a search that will take longer. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #13 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 189032 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189032&action=edit Bug 41039: Add cypress tests Patch from commit 2fcd87f -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #14 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching, will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. Test Plan: 1) Browse to members-home.pl 2) Open the network tab of the developer console on your web browser 3) Double click the Search button 4) Note the two api requests in the network tab 5) Apply this patch 6) Reload the page 7) Double click the Search button 8) Note only one api request is made If your results come back too fast, you may perform an initial search, then change the number of results from the default 20 to "All" to create a search that will take longer. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188191|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=41039 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189031|0 |1 is obsolete| | Attachment #189032|0 |1 is obsolete| | --- Comment #15 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 189649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189649&action=edit Bug 41039: Prevent patron search button from being spammed triggering multiple api requests Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching, will trigger another patron search api request. This button should be disabled until the first searches results are displayed. To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request. Test Plan: 1) Browse to members-home.pl 2) Open the network tab of the developer console on your web browser 3) Double click the Search button 4) Note the two api requests in the network tab 5) Apply this patch 6) Reload the page 7) Double click the Search button 8) Note only one api request is made If your results come back too fast, you may perform an initial search, then change the number of results from the default 20 to "All" to create a search that will take longer. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #16 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 189650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189650&action=edit Bug 41039: Add cypress tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #17 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|RM_priority |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.11.00 |25.11.00,25.05.06 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 --- Comment #18 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|25.11.00,25.05.06 |25.11.00,25.05.06,24.11.11 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Every click of the "Search" release notes| |button in patrons searching | |form | |was triggering another | |patron search API request. | |This button is now disabled | |after click until the first | |searches results are | |displayed. Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #20 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org