Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.4.3: debounce AJAX select elements, avoid server overload - followup #1052 #1081

Closed
lkraav opened this issue Apr 16, 2020 · 3 comments · Fixed by #1082
Closed

3.4.3: debounce AJAX select elements, avoid server overload - followup #1052 #1081

lkraav opened this issue Apr 16, 2020 · 3 comments · Fixed by #1082

Comments

@lkraav
Copy link
Contributor

lkraav commented Apr 16, 2020

Followup to #1052

Bug Report

One AJAX request is triggered for every keypress on Users dropdown.

My platform site currently has 15000 users, this is a real query bomb if you type a whole e-mail in there to try to narrow it down.

Expected Behavior

Select element should only trigger query after probably 0.5s has passed after last keystroke.

Steps to Reproduce the Problem

  1. Open Network panel

  2. Type into Users filter select element

  3. Observe network request triggered for each keystroke

@kasparsd
Copy link
Contributor

Is the input field using the select2 input wrapper? I wonder if they provide throttling out of the box for this and we just haven't enabled it.

@lkraav
Copy link
Contributor Author

lkraav commented Apr 16, 2020

Yep, it's Select2. And this is what we did in Sensei Automattic/sensei#2282 super simple.

@oscarssanchez
Copy link
Contributor

Hi there, I can confirm this takes down a site with 30k users. Solution proposed by @lkraav works for me.

@kasparsd kasparsd added this to the Version 3.4.4 milestone Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants