This is also papering over the larger issue of the insane refilter count
and is basically a drive-by fix but rider is bugging me with a bunch of
yellow highlights from memory churn which looks somewhat easily
preventable.
Basically the cancellation of filters could only take place between full
groups. If there are few groups with lots of beatmaps, it could be a
*looooong* while before the cancellation of the filter would actually
take place. Hence the added extra cancellation check before every
individual group item, and one extra check before performing the set
mapping exchange and items return.
This papers over most of https://github.com/ppy/osu/issues/34507.
The full failure scenario is:
- user selects a beatmap set
- online lookups fire
- online lookups are populated back to realm
- the realm changes trigger subscription, which triggers detached store
replace, which triggers refilter
- refilter takes a while
- during the refilter user may be unable to select some sets because the
set header mapping is incomplete
This only papers over the last bullet of that, in making sure that the
set header mapping is not externally accessed while it's being rebuilt.
It doesn't fix the insane amount of refilters caused by everything
preceding the refilter being overeager to trigger said refilter.