Code Insights: Backend insights are blocked from loading filters until all of the other insights on the page are done loading
- Truncate descriptions
Created by: vovakulikov
Blocked by https://github.com/sourcegraph/sourcegraph/issues/24236
Original message from @coury-clark about the problem
It seems like backend insights are blocked from loading filters until all of the other insights on the page are done loading. Is this intentional? It creates a pretty weird experience if there are lots of extension based insights on the page - earlier I had to wait a few minutes before I could filter the insight I was interested in to let everything load
The root cause
With 1 by 1 insight loading system (useParallelRequest), we queue our requests in one sequence and run them in parallel by 2 insights. When you change your filters this is another request to the BE by we already got some insight to load in our pool. I assume to avoid this problem we have to introduce some prioritization system to up a new important request like filters in the request queue.
Tech notes
Unfortunately, I don't know the way how to change the order of events in the observable pipeline. But It seems that we have to do exactly that. When some insights are loading we have them fetch observable requests in the concurrent pool of the mergeMap
operator. For now, I think the only way to introduce a prioritization system is to request we have to move away from the RxJs operators for concurrency and implement a queue with prioritization by ourselves.