Fix song select crashing on beatmap with two difficulties of same online ID
- Closes https://github.com/ppy/osu/issues/33552
As per the thread above, this can be repro'd by using the editor's "external edit" feature and either have two difficulties with the same name but different online IDs, or two difficulties with the same online ID but different names (the case in the thread above).
I was going to add test coverage for this, but the scenarios are weird enough that perhaps this should be properly fixed in a post-process that is fired after the user finishes editing beatmaps externally. But until that happens, I'm not sure if the relevant code in carousel should be as strict as it is. I've left a TODO comment at least.
but the scenarios are weird enough that perhaps this should be properly fixed in a post-process that is fired after the user finishes editing beatmaps externally
I'm not sure how this invalidates the need for a test.
To reiterate, this change is more of a workaround for a very edge case that doesn't even make sense to test for, but since you find it better, I'll push the test.
Where are we with this PR? There are still duplicates streaming in of this exact crash trace. Latest being https://github.com/ppy/osu/issues/34655.
I'm hoping to get @peppy's response on whether it's OK to remove this TODO comment as you suggested in https://github.com/ppy/osu/pull/33558#discussion_r2174634284. I don't have any opinion on that myself because I'm not well-versed in this area. The fix/workaround is ready to go otherwise.
If you two can agree on a forward path here then I'm fine with that. Just make sure it's documented.
compile failures