Searching for taxon on Identify stalls out

did this really just start happening lately? it seems like this must be an old issue.

i bet what’s happening is that you’re working faster than the system likes. i believe that each time you type (or remove) a character in that taxon selection box, you’re hitting the API with an autocomplete request, and i don’t think the system likes it when you hit it with too many requests over a short period of time. the API notes say you’re supposed to try to keep requests below 100 per minute, and my experience is that if you start exceeding a certain running average request rate (maybe something like 1 request per sec over the last 60 seconds), the API starts refusing your requests.

if you pull up the your browser’s developer tools and look at the network activity, you’ll see a request each time you type (or remove) a letter in that taxon box. try typing “bunnies” then backspacing then retyping, etc. a few times, and you should see that eventually the console starts logging errors to the effect of “too many requests”, and that’s the point where you’ll no longer get the proper autocomplete suggestions for bunnies (which can appear to be “stalling out” in some cases). if you wait a bit (thereby allowing your running average request rate to drop), the API will start accepting requests again. (so the next letter you type or remove from the box should return proper autocomplete results.)

i think this kind of thing could be what’s also causing the issue described here (https://forum.inaturalist.org/t/place-weirdness-in-identify-modal/4236), since the lookup of the country is also an API request.

UPDATE: i improved some of the text above, and just to help people understand what i was saying a little better, i’m attaching this screenshot below:tbd_stall
on the left side of the screenshot, you’ll see that I’ve forced a taxon selection box to “stall”. i typed “bunnies” into the box, but judging by the items in the taxa menu, the autocomplete appears to have “stalled” at “bu”. now look at the top right quadrant of the screenshot. you’ll see the last few items are autocomplete requests. you can see that starting with the autocomplete request for “bun”, i started getting 429 error codes. looking at the bottom right quadrant of the screenshot, you can see that 429 translates to “TOO MANY REQUESTS: the server is refusing to service the request because too many requests have been submitted by the client…” in other words, the last thing the server gave me successfully were autocomplete results for “bu”, and it refused to process anything else after that, which is why the taxon selection menu shows me things like “Buteos” and “Bugs” and “Butterflies” (not “Bunnies”).

2 Likes