Open jcscottiii opened 1 month ago
It is likely getting caught in the ANY_VALUE term
May need to change the grammar to be something like this:
search_criteria:
generic_search_term
- | ANY_VALUE; // Default to ANY_VALUE search without "name:" prefix.
+ | ('name:' ANY_VALUE); // Implicit name search for ANY_VALUE
From the Jun 11, 2024 error report
Here are some other invalid queries that should return 4xx instead of 5xx
available_on:chrome available_on:firefox available_on:safari baseline_status:widely name:"a substring" baseline_status:widely -
available_on:chrome available_on:firefox available_on:safari baseline_status:widely name:"a substring" baseline_status:widely -
available_on:chrome available_on Secured AI available_on:safari available_on:firefox
available_on:chrome available_on generative AI available_on:safari available_on:firefox
For the first two queries, there was a trailing -
. We need a new way to detect if the -
is by itself then return a 400
The last two queries are similar to the original report where the user submitted available_on
without the colon. Since this is happening more, I wonder if there is something we can do on the frontend to prevent the users from thinking available_on is okay to submit by itself.
If this is not urgent I can look into it in the next few days/weeks.
Expected behavior
available_on
without the colon and valueActual behavior
available_on
without the colon and valueOther notes:
available_on:
) returns a 400 error like expected