Quick search make requests for each typed character in some cases, causing 403 errors

Reproduction steps:

  1. Open the quick search input while being in a category
  2. Click on the “in this category” option
  3. Type a few letters
  4. There is a search query performed for each character typed with no waiting time, leading to a 403 error

It seems to happen more when unregistered, maybe because of a different rate limit.

search rate limit bug

Notes: It doesn’t happen if you write the #categoryname manually, and after you delete your search query input to perform another search.

4 Likes

The bug is still here, I see all the requests in the network tab, but I haven’t experienced the error message for a while. Were the max requests per second increased for users?

Also, it’s to be noted that while this bug happens on meta.discourse.org and try.discourse.org, it doesn’t happen on my instances.

Perhaps is it related to some setting?

2 Likes

will put a pri-medium on investigating, cause this has potential of driving too much traffic, unnecessarily.

2 Likes

It depends on the typing speed. If you type fast enough, the request won’t be sent for each keystroke. The widget debounces sending the request every 400 milliseconds, if user types below that threshold, the request won’t be sent. Tested on Safari/Firefox/Chrome on macOS, it works well on each.

You can see this as proof:

CleanShot 2025-03-25 at 09.33.00@2x

It only sent two requests between typing “Theme component data” and “Theme component data expl”, i.e. no requests for the characters in between.

2 Likes