[Bug 40336] New: Self-checkouts restart every second if invalid data in timeout sysprefs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 Bug ID: 40336 Summary: Self-checkouts restart every second if invalid data in timeout sysprefs Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: blocker Priority: P5 - low Component: Self checkout Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org As per comments on bug 36586, there are situations where self-checkouts restart every second. The cause - or at least one identified cause - appears to be invalid data in the SelfCheckInTimeout and SelfCheckTimeout system preferences. The Javascript isn't properly validating the incoming data and thus the bug appears. -- 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=40336 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | Depends on| |36586 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36586 [Bug 36586] Self-checkouts will get CSRF errors if left inactive for 8 hours -- 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=40336 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=40336 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 183910 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183910&action=edit Bug 40336: Validate timeout syspref for self-checks This patch validates the numbers passed to the self-check timeout code, so that it must be a valid number >= 10 seconds. If it fails this validation, it defaults to 120 seconds. Test plan: 0. Apply the patch 1. Enable the SelfCheckInModule and WebBasedSelfCheck syspref 2. Try out these modules using varying values in the SelfCheckInTimeout and SelfCheckTimeout system preferences resepectives. For instance: - A blank space (ie " ") - A negative number (e.g. -7) - An alphabetic string (e.g. aa) - A positive number less than 10 (e.g. 5) - A positive number greater than 10 (e.g. 60) 3. Check the "idle_timeout" value set in the timer objects using the following in the browser console: console.log(window.sci_login_timer); console.log(window.sco_login_timer); 4. Note that all cases except positive numbers greater than or equal to 10 get reset to 120 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi --- Comment #2 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Tested this on SCO and all values expect positive 10 or greater indeed reset to 120. But I'm still seeing constant restarting even with these values. So patch does work as intended but doesn't solve the whole problem. I'll try to set up a SCI on my environment and test that too just to be sure. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #3 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Tested now with SCI, same results. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- It would be good to have systempreferences.type supports "integer" and have such problems caught before (during the input). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #5 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Sorry David, we've decided to revert Bug 36586 for now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Emmi Takkinen from comment #2)
Tested this on SCO and all values expect positive 10 or greater indeed reset to 120. But I'm still seeing constant restarting even with these values. So patch does work as intended but doesn't solve the whole problem. I'll try to set up a SCI on my environment and test that too just to be sure.
Do you have an Internet accessible Koha that can reproduce this problem? I could take a look there. Otherwise, I think I've troubleshooted this as far as I can. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #4)
It would be good to have systempreferences.type supports "integer" and have such problems caught before (during the input).
Agreed. This would be a good use case for adding syspref validation methods. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Lucas Gass (lukeg) from comment #5)
Sorry David, we've decided to revert Bug 36586 for now.
No worries. Did you try out the patch or was it a strategic decision? Based off Emmi's experience, it looks like there could be something else going on there in any case. Locally, we are suspending CSRF for self-check for older versions without bug 40108. I guess we'll just keep doing that until some other fix is done. We recently had an experience where a library's PC catalogue was resubmitting the opac-search.pl every second which was interesting. Library staff suspect a glitch with the kiosk software (rather than Koha) but who knows. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #8)
Locally, we are suspending CSRF for self-check for older versions without bug 40108. I guess we'll just keep doing that until some other fix is done.
Sorry I meant bug 36586 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #10 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to David Cook from comment #6)
(In reply to Emmi Takkinen from comment #2)
Tested this on SCO and all values expect positive 10 or greater indeed reset to 120. But I'm still seeing constant restarting even with these values. So patch does work as intended but doesn't solve the whole problem. I'll try to set up a SCI on my environment and test that too just to be sure.
Do you have an Internet accessible Koha that can reproduce this problem? I could take a look there.
Otherwise, I think I've troubleshooted this as far as I can.
All our Koha instances have restricted access. But I can try to take a look at this and see if what I can find. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #11 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- David, you were on the right track with this. I ran code from bug 36586 through Copilot and it pointed out that variable const idle_timeout has to be converted as number also in function login_timeout found from sci-main.tt and sco-main.tt: const idleTimeout = Number("[% Koha.Preference('SelfCheckTimeout') | html %]"); This stopped the constant refreshing. Unfortunately with this bugs patch in place converting no longer helps no matter how many Number() methods I add :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 --- Comment #12 from David Cook <dcook@prosentient.com.au> --- (In reply to Emmi Takkinen from comment #11)
David, you were on the right track with this. I ran code from bug 36586 through Copilot and it pointed out that variable const idle_timeout has to be converted as number also in function login_timeout found from sci-main.tt and sco-main.tt: const idleTimeout = Number("[% Koha.Preference('SelfCheckTimeout') | html %]"); This stopped the constant refreshing. Unfortunately with this bugs patch in place converting no longer helps no matter how many Number() methods I add :D
Sorry I'm very confused about what you're trying to say here. It sounds like you're saying that the patch works, but that it also does not work? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40336 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|dcook@prosentient.com.au |koha-bugs@lists.koha-commun | |ity.org Resolution|--- |INVALID Status|Needs Signoff |RESOLVED --- Comment #13 from David Cook <dcook@prosentient.com.au> --- I suppose it doesn't really matter anyway since bug 36586 has been reverted. -- 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=40336 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42200 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org