Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiplayer song select not correctly applying filter sometimes #30425

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Oct 25, 2024

RFC. Fixes the root client-side failure causing #30415.

Thread of breakage is as follows:

  1. SongSelect loads the carousel. At this point, the ruleset is what the ambient ruleset would have been at the time of pushing song select, so most likely it will match the current ruleset. Notably, the carousel is loaded with AllowSelection == false.
  2. OnlinePlaySongSelect sets the ruleset to the one taken from the relevant playlist item in LoadComplete().
  3. At any point between the previous and the next step, the user changes the ruleset manually.
  4. SongSelect.carouselBeatmapsLoaded() is ran, which calls transferRulesetValue(), which calls FilterControl.FilterChanged. But at this stage Carousel.AllowSelection is still false, so the filter is not executed, but pendingFilterApplication is set instead. Unfortunately, the pending filter never gets applied after that. The only place that checks that flag is OnEntering(), which at this point has already ran.

To fix, move the pendingFilterApplication check to Update(), which seems like the most obvious and safe solution.

Fixes the root client-side failure causing
ppy#30415.

Thread of breakage is as follows:

1. `SongSelect` loads the carousel.
   At this point, the ruleset is what the ambient ruleset would have
   been at the time of pushing song select, so most likely it will
   match the current ruleset.
   Notably, the carousel is loaded with `AllowSelection == false`.
2. `OnlinePlaySongSelect` sets the ruleset to the one taken from
   the relevant playlist item in `LoadComplete()`.
3. At any point between the previous and the next step, the user
   changes the ruleset manually.
4. `SongSelect.carouselBeatmapsLoaded()` is ran, which calls
   `transferRulesetValue()`, which calls `FilterControl.FilterChanged`.
   But at this stage `Carousel.AllowSelection` is still false, so
   the filter is not executed, but `pendingFilterApplication` is set
   instead.
   Unfortunately, the pending filter never gets applied after that.
   The only place that checks that flag is `OnEntering()`, which at
   this point has already ran.

To fix, move the `pendingFilterApplication` check to `Update()`, which
seems like the most obvious and safe solution.
@bdach bdach added area:song-select area:multiplayer next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! labels Oct 25, 2024
@bdach bdach requested a review from peppy October 25, 2024 20:35
@bdach
Copy link
Collaborator Author

bdach commented Oct 28, 2024

FWIW, I wouldn't be surprised if this happens to fix #29751 too.

@Joehuu
Copy link
Member

Joehuu commented Oct 28, 2024

FWIW, I wouldn't be surprised if this happens to fix #29751 too.

Doesn't seem to fix that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:multiplayer area:song-select next release Pull requests which are almost there. We'll aim to get them in the next release, but no guarantees! size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants