Streaming search: stream filters
Created by: camdencheek
Currently, we don't send filters until a search has completed. This means that we don't render the sidebar dynamic filters until the end of the search. This leads to a somewhat jarring page flashing where 1) you start a search, 2) the first results show up, 3) the search completes and the dynamic filters load.
This updates the backend to stream filters instead. Currently, it computes and sends filters whenever we flush matches. I don't think this will be practically too expensive, given the relatively low cardinality of repos compared to matches, but I'll keep an eye on profiles in prod, but it seems fine locally. If it is too expensive, I'm pretty sure we can compute filters incrementally as we stream.
Additionally, this fixes an rxjs issue I noticed with throttleTime
. Basically, with leading and trailing set for throttleTime
, it no longer guarantees a minimum separation between output events. This causes a "galloping" effect in the UI where you'll see pairs of very close updates. It looks very unnatural.
Test plan
Manually tested. See attached video for results.