Skip to content

search: return alert for lucky alternate queries

Administrator requested to merge rvt/lucky-alertsx into main

Created by: rvantonder

This propagates err/alerting so you see this for lucky search:

Screen Shot 2022-06-07 at 6 44 09 PM

The alert isn't perfect, I'm using our "proposed queries" logic, and would probably like something a bit more fit for purpose. I also don't like that it's SO HUGE. Something more subtle like Google's "did you mean" would be better for this lucky search application. Wonder if @limitedmage has a sense for how we could make the layout of this notification more snazzy, it could go a long way I think!

Re backend: I ran into one annoying thing in the implementation, which is: It's easy to have every generated query/job return it's attempted query, but this will result in a frontend alert for each job, but I want to actually group all attempted queries into one list of "proposed queries" i.e., alternate queries, like you see in the screenie.

I found it difficult to shape the code to collect proposed queries as-jobs-run, and especially challenging to then just propagate one alert/error. I thought to change the Sequential job itself, to collect these, but this starts to get overly specific to "Lucky Search" and not "general sequential primitive". So in the end, I created a new job to serve this role, which, when Run, sends the alternate queries err, and this job is always run first before any generated queries (and doesn't actually return results). This works well enough, just a bit annoying and pollutes the size of different kinds of jobs we have. Another consequence of not really having notifications/alerting as a real first class thing. Work for another day.

Test plan

Updated unit tests.

Merge request reports

Loading