Falls into the age-old trap of attempting to retrieve an item from realm
without first ensuring that realm is in an up-to-date state.
Consider this scenario:
- Editor is entered from main menu, causing it to create a new beatmap
from its async `load()` method.
- Editor opens correctly, then main thread performs a file operations on
the same beatmap.
- Main thread is potentially not refreshed yet, and will result in `null`
instance when performing the re-fetch in `performFileOperation`.
I've fixed this by using the safe implementation inside `RealmLive<T>`.
Feels like we want this is one place which is always used as the correct
method.
On a quick search, there are 10-20 other usages of `Realm.Find<T>` which
could also have similar issues, but it'll be a bit of a pain to go
through and fix each of these. In 99.9% of cases, the accesses are on
instances which couldn't have just been created (or the usage of
recently-imported/created is blocked by realm subscription flows, ie.
baetmap import) so I'm not touching them for now.
Something to keep in mind when working with realm going forward though.
This created weird cases in logs which are very hard to understand. The
one which really got me was this:
```
[runtime] 2023-08-13 07:48:27 [verbose]: Invalidating working beatmap cache for unknown artist - unknown title (Dummy)
```
Which looks like a dummy working beatmap was invalidated, but it turns
out that's just the local user which was populated when creating a new
local beatmap.
Closes#24503.
The problematic reset of `lastParticleAdded` has been moved to a place
that should hopefully (a) not cause such problems and (b) be much more
explicit about what's happening.
Closes#24514.
The original PR was _supposed_ to be handling this, and had code that
_looked_ like it would handle it, but was in fact subtly wrong, as the
union of `RectangleF.Empty` (initial value of `area`) and an arbitrary
other rectangle is _not_ the second rectangle, but rather a rectangle
that contains _both_ the second rectangle and the point (0,0),
thus leading to the bound calculation fail.