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

Beatmaps hidden difficulties show 0 stars #10458

Closed
Gabixel opened this issue Oct 9, 2020 · 9 comments · Fixed by #10489
Closed

Beatmaps hidden difficulties show 0 stars #10458

Gabixel opened this issue Oct 9, 2020 · 9 comments · Fixed by #10489

Comments

@Gabixel
Copy link
Contributor

Gabixel commented Oct 9, 2020

Describe the bug: (As title) Probably an issue with the dynamic calculation?

Screenshots or videos showing encountered issue:
image
image
image

osu!lazer version: 2020.1009.0

@Gabixel Gabixel changed the title Beatmap's hidden difficulties show 0 stars Beatmaps hidden difficulties show 0 stars Oct 9, 2020
@cdwcgt
Copy link
Contributor

cdwcgt commented Dec 8, 2023

FK4qszAvi5

I asked about this on the discord server but got no response
I encountered this problem after a certain lazer version, and it has never been solved.

some beatmapset have current difficulties, but mostly 0*
expanded map panel it will give me difficult but cannot sort.

database.log
updater.log
runtime.log
network.log
performance.log
client.zip

@cdwcgt
Copy link
Contributor

cdwcgt commented Dec 10, 2023

image

diff --git a/osu.Game/BackgroundDataStoreProcessor.cs b/osu.Game/BackgroundDataStoreProcessor.cs
index 90e55dea6d..39abdb0936 100644
--- a/osu.Game/BackgroundDataStoreProcessor.cs
+++ b/osu.Game/BackgroundDataStoreProcessor.cs
@@ -134,18 +134,16 @@ private void processBeatmapSetsWithMissingMetrics()
                 // of other possible ways), but for now avoid queueing if the user isn't logged in at startup.
                 if (api.IsLoggedIn)
                 {
-                    foreach (var b in r.All<BeatmapInfo>().Where(b => b.StarRating < 0 || (b.OnlineID > 0 && b.LastOnlineUpdate == null)))
+                    foreach (var b in r.All<BeatmapInfo>().Where(b => (b.StarRating < 0 || (b.OnlineID > 0 && b.LastOnlineUpdate == null)) && b.BeatmapSet != null))
                     {
-                        Debug.Assert(b.BeatmapSet != null);
-                        beatmapSetIds.Add(b.BeatmapSet.ID);
+                        beatmapSetIds.Add(b.BeatmapSet!.ID);
                     }
                 }
                 else
                 {
-                    foreach (var b in r.All<BeatmapInfo>().Where(b => b.StarRating < 0))
+                    foreach (var b in r.All<BeatmapInfo>().Where(b => b.StarRating < 0 && b.BeatmapSet != null))
                     {
-                        Debug.Assert(b.BeatmapSet != null);
-                        beatmapSetIds.Add(b.BeatmapSet.ID);
+                        beatmapSetIds.Add(b.BeatmapSet!.ID);
                     }
                 }
             });

@bdach
Copy link
Collaborator

bdach commented Dec 11, 2023

@cdwcgt you have a single beatmap without a set in your local database. This is not supposed to happen, hence the assertions in the code you have patched above. Since you are capable of writing code, I cannot discount the possibility of this being a data anomaly that you yourself have called into being.

Thus, unless you can replicate a way to create a beatmap without a set via the editor on current master, I don't think we want the patch above until this is proven to be affecting a bigger number of users.

@peppy
Copy link
Member

peppy commented Dec 11, 2023

@bdach Weirdly, I've managed to repro the detached-beatmap-from-set thing repro multiple times from a stable import. I haven't had a chance yet to figure out how it happens... but it might be worth guarding defensively against..

I'm not sure if it can help with investigation, but it's also repro on my current database (run with debug and it should hit an assert on startup).

client_36.realm.zip

@bdach
Copy link
Collaborator

bdach commented Dec 11, 2023

from a stable import

I wouldn't really expect a stable import to trigger this either, but it may be worth looking into. That said I'm not sure a post-facto broken database is going to help any. Logs from the stable import might. Or a dump of the actual data being imported from stable.

I guess we could add the guard. But I'm loath to do it because things will silently corrupt anyways but in a slightly different way. There's a whole bunch of places that may also blow up on a beatmap with no set.

@peppy
Copy link
Member

peppy commented Dec 11, 2023

There's a whole bunch of places that may also blow up on a beatmap with no set.

Agree, but it looks like the aforementioned case is going to be breaking all processing on a hidden background thread. Seems like one we should consider fixing..

peppy added a commit to smoogipoo/osu that referenced this issue Dec 13, 2023
@peppy
Copy link
Member

peppy commented Dec 13, 2023

Adding a sneaky fix for this one in peppy@0611a1d.

@bdach
Copy link
Collaborator

bdach commented Dec 13, 2023

bit of a weird place to apply that in but sure.

@peppy
Copy link
Member

peppy commented Dec 13, 2023

Dunno, was touching the same class and I kinda want to make this fix happen without much attention for now 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants