-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Extract leaderboard fetch logic from song select beatmap leaderboard drawable #32494
base: master
Are you sure you want to change the base?
Conversation
…drawable RFC. Another attempt at this. - Supersedes ppy#31881 - Supersedes / closes ppy#31355 - Closes ppy#29861 This is a weird diff because I am feeling rather boxed in by all the constraints, namely that: - Leaderboard state should be global state - But the global state is essentially managed by song select and namely `BeatmapLeaderboard` itself. That's because trying to e.g. not have `BeatmapLeaderboard` pass the beatmap and the ruleset to the global leaderboard manager is worse, as it essentially introduces two parallel paths of execution that need to be somehow merged into one (as in I'd have to somehow sync `LeaderboardManager` responding to beatmap/ruleset changes with `BeatmapLeaderboard` which is inheritance hell) - Also local leaderboard fetching is data-push (as in the scores can change under the leaderboard manager), and online leaderboard fetching is data-pull (as in the scores do not change unless the leaderboard manager does something). Also online leaderboard fetching can fail. Which is why I need to still have the weird setup wherein there's a `FetchWithCriteriaAsync()` (because I need to be able to respond to online requests taking time, or failing), but also the `BeatmapLeaderboard` only uses the public `Scores` bindable to actually read the scores (because it needs to respond to new local scores arriving). - Another thing to think about here is what happens when a retrieval fails because e.g. the user requested friend leaderboards without having supporter. With how this diff is written, that special condition is handled to `BeatmapLeaderboard`, and `LeaderboardManager`'s state will remain as whatever it was before that scope change was requested, which may be considered good or it may not (I imagine it's better to show scores in gameplay than not in this case, but maybe I'm wrong?)
This looks better to me on a brief pass. I'll defer full review to @peppy. |
Sorry for the late response. I am also on board with this direction. It seems that this is a soft dependency for moving forward with song select, so would be interested in seeing things move forward so it's not blocking (although keep in mind there's still a lot of other things blocking release so it's not super urgent). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented.
RFC. Another attempt at this.
This is a weird diff because I am feeling rather boxed in by all the constraints, namely that:
BeatmapLeaderboard
itself. That's because trying to e.g. not haveBeatmapLeaderboard
pass the beatmap and the ruleset to the global leaderboard manager is worse, as it essentially introduces two parallel paths of execution that need to be somehow merged into one (as in I'd have to somehow syncLeaderboardManager
responding to global beatmap/ruleset changes withBeatmapLeaderboard
which is also doing the same viaRefetchScores()
inheritance hell)FetchWithCriteriaAsync()
(because I need to be able to respond to online requests taking time, or failing), but also theBeatmapLeaderboard
only uses the publicScores
bindable to actually read the scores (because it needs to respond to new local scores arriving).BeatmapLeaderboard
, andLeaderboardManager
's state will remain as whatever it was before that scope change was requested, which may be considered good or it may not (I imagine it's better to show any scores in gameplay than not in this case, but maybe I'm wrong?)