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

WebHost: add startup option to clean datapackages #3207

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Berserker66
Copy link
Member

What is this fixing or adding?

Allows cleaning datapackage entries that have the wrong checksum. They're deleted entirely, which should be fine for the server, though some clients may break. This is a very small may though, as it should only affect clients that relied on a miscontructed apworld.

How was this tested?

copied the checksum from one row and the data from another row, then watched how only that row disappeared on startup.

If this makes graphical changes, please attach screenshots.

@github-actions github-actions bot added the affects: webhost Issues/PRs that touch webhost and may need additional validation. label Apr 24, 2024
@github-actions github-actions bot added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Apr 24, 2024
@ThePhar ThePhar added the is: maintenance Regular updates to requirements and utilities that do not fix bugs or change/add features. label Apr 24, 2024
@ThePhar
Copy link
Member

ThePhar commented Apr 24, 2024

Do you think this should also be added to docs/webhost configuration sample.yaml?

@Berserker66
Copy link
Member Author

No idea, if you think it should, feel free to PR it in.

Copy link
Member

@ThePhar ThePhar left a comment

Choose a reason for hiding this comment

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

Works as advertised.

@ThePhar
Copy link
Member

ThePhar commented Apr 24, 2024

Additional clarification was made in Discord, so going to post it here so it's not lost.

Essentially found out this check will not work for the issue described in #3206 because upload.py ends up overriding the checksum on both the column and in the data package of the uploaded file with the re-calculated value so it's essentially impossible to look for if the rest of the data package is technically valid.

Leaving my approval, but unless someone can think of another reason this could be useful (maybe there was another way data packages could be corrupt?), I don't think this will be necessary.

@black-sliver
Copy link
Member

I feel like this should be a click instead, so you can just run flask cleanup-database in a separate process in the same venv without impacting the running instance.

@black-sliver
Copy link
Member

As for what to clean out, I think it should (also) search for unreferenced game packages, so that when seeds are deleted we also delete the corresponding games packages on the next cleanup. (Since this needs to load all rooms and create a massive set, I don't think that can be done on startup, but needs to run in a separate process.)

@ThePhar
Copy link
Member

ThePhar commented Apr 24, 2024

As for what to clean out, I think it should (also) search for unreferenced game packages, so that when seeds are deleted we also delete the corresponding games packages on the next cleanup. (Since this needs to load all rooms and create a massive set, I don't think that can be done on startup, but needs to run in a separate process.)

Yeah, I think that should be doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: webhost Issues/PRs that touch webhost and may need additional validation. is: maintenance Regular updates to requirements and utilities that do not fix bugs or change/add features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants