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

Add separate beatmap update flow to handle edge cases better #19378

Merged
merged 20 commits into from
Jul 26, 2022

Conversation

peppy
Copy link
Member

@peppy peppy commented Jul 25, 2022

Pushing this to allow any feedback on the general flow. Will add more tests over the next day.

  • Add more test coverage

A few standout commits which aren't mentioned above:

2e14d87 Move implementation of updating a beatmap to BeatmapImporter

Required to be able to write isolated tests without constructing a BeatmapManager or BeatmapUpdater. But also feels like it's probably the best place to put this logic (if not BeatmapManager, I guess).

6a3e8e3 Centralise calls to reset online info of a BeatmapInfo

Until now we were only resetting the OnlineID in multiple places, which leaves a beatmap in a state where it thinks it can still receive updates, even though the intention is that it shouldn't. This can be split out into its own PR if required.

@peppy peppy added the realm deals with local realm database label Jul 25, 2022
@@ -670,6 +670,116 @@ public void TestImportThenDeleteThenImportOptimisedPath()
});
}

[Test]
Copy link
Member Author

@peppy peppy Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to put these in a separate file, but splitting out this test feels like it should be done as a separate pass. There's a lot of helper methods and reorganisation to be done.

Scratch that, I already managed to avoid using any dependencies while rewriting these.

@smoogipoo
Copy link
Contributor

smoogipoo commented Jul 26, 2022

I can't make sense of this PR and the classes contained.

@peppy peppy added the blocked Don't merge this. label Jul 26, 2022
@peppy
Copy link
Member Author

peppy commented Jul 26, 2022

I've applied changes in 8370ca9 to address the issues you've mentioned (mostly). We agree that there needs to be better separation of concerns (ie. ModelDownloader should probably not be importing in the first place), but that will happen as a follow-up.

@smoogipoo
Copy link
Contributor

Updated structure is much more readable 👍

@peppy peppy removed the blocked Don't merge this. label Jul 26, 2022
@peppy
Copy link
Member Author

peppy commented Jul 26, 2022

Tests added, all ready to go.

@smoogipoo smoogipoo merged commit 8f7dff5 into ppy:master Jul 26, 2022
@peppy peppy deleted the beatmap-update-test branch July 28, 2022 08:12
This was referenced Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
realm deals with local realm database size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Beatmap with missing online ID duplicating when updated
2 participants