Unhandled 400 error when typing more than 10 comma-separated ML class search terms
Sentry Issue: ARKINDEX-FRONTEND-J7
Error: Request failed with status code 400
at call (./js/api.js:74:85)
at u (None:1:410)
at a (None:1:410)
at l/</< (None:1:410)
at l/< (None:1:410)
...
(36 additional frame(s) were not displayed)
The frontend currently prevents sending over 10 space-separated search terms to the ListCorpusMLClasses
API, since we have a limit on search terms. However, Django REST Framework is responsible for the splitting into search terms, and commas are replaced with spaces. When typing something like 1,2,3,4,5,6,7,8,9,0,ohno
, the frontend treats it as one search term and sends it to the backend, but the backend sees eleven terms, causes a HTTP 400 and the frontend does not display it or handle it in any way.