kinsi55 / BeatSaber_BetterSongList

Adds Various improvements to the Basegame song list like Filters, a persisted state and much more
MIT License
43 stars 11 forks source link

Fix `_hideDetailViewController` not being reset properly #31

Closed nicoco007 closed 1 year ago

nicoco007 commented 1 year ago

_hideDetailViewController doesn't get reset properly in LevelCollectionNavigationController.DidActivate and causes a race condition that doesn't dismiss view controllers properly on the level end screen if:

  1. a song is automatically selected by BSL when coming from the main menu
  2. the active tab is a non-level-pack tab (i.e. favorites or all songs)
  3. a view controller is presented on the level end screen's right pane (e.g. by BeatSaviorData)

This causes ClearChildViewControllers to be called too early and eventually HMUI.Screen.SetRootViewController gets called twice in a row for the same screen, which in turn causes TransitionCoroutine to be cancelled so the previous view controller (i.e. the leaderboard) is never dismissed/disabled.

Basically, this is a fix for this issue: 266186716-3d2aeb1b-727f-4a95-9b23-088ecc162017

kinsi55 commented 1 year ago

Based off a 1 minute decompiler check, am I assuming correctly that the fix would also work properly if you only set it to false if addedToHierarchy is true?

nicoco007 commented 1 year ago

Maybe, but since the issue is related to ClearChildViewControllers, the else if (_loading) might also come into play at some point. ClearChildViewControllers is eventually called by all code paths so I thought it'd be simpler to just set it to false no matter what.

kinsi55 commented 1 year ago

I see, well its more or less essentially a basegame issue (Since I use basegame logic to set the start state) so please report to devs 👍