Perform online ID checks during import in more proper sequence #36102
+37
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The overarching theme here is preventing https://osu.ppy.sh/community/forums/topics/2162457?n=8 from happening again.
Recommend reading commit-by-commit because the diff of the entire PR makes it look way worse than it actually is.
Move online ID validation check into its proper location
The end of
Populate()is too early to do any validation of online IDs of this kind, as population happens inPostImport()viaProcessBeatmap.Additionally, this modifies the check to also include the set's ID. This is one part of curtailing issues like https://osu.ppy.sh/community/forums/topics/2162457?n=8 - the featured artist template beatmap in question has a single difficulty with a bogus positive beatmap set ID and a beatmap ID of 0, and my opinion is that this sort of situation should for all intents and purposes cause the beatmap set's ID to be reset even if you have multiple difficulties with clearly invalid IDs.
Only perform replace-on-import based on online beatmap set ID after it's validated
Even without the ID resetting logic before
Populate()getting broken and annotated with a TODO, this was kinda stupid. Why was purging logic allowed to run using a not-yet-completely-validated online ID of the set?This is the other part of hopefully fixing scenarios like https://osu.ppy.sh/community/forums/topics/2162457?n=8 (hopefully with no babies poured out with the bathwater, but only time will tell).
At least the update flow appears to still function correctly.