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

fix: ensure frozen state on database and cache are in sync on !map #534

Merged
merged 6 commits into from
Nov 29, 2023

Conversation

minisbett
Copy link
Contributor

Describe your changes

When using the !map command to update the status of a beatmap the map is always being frozen. Currently however, the code does set frozen to true in the database, but for the local cache it only updates the status.

I noticed this when debugging #420 and this PR might offer the solution for that issue. I invalidated the cache when debugging (_cache_expired always returned true) which meant it's always being fetched from the api, which caused the status to be reverted because when checking whether it's frozen on the api check it wasn't (since it checks the cache where it was false, not the database where it's true).

Related Issues / Projects

Checklist

  • I've manually tested my code
  • The changes pass pre-commit checks (make lint)
  • The changes follow coding style

app/commands.py Show resolved Hide resolved
@cmyui cmyui added the bug Something isn't working label Sep 29, 2023
app/commands.py Outdated Show resolved Hide resolved
app/commands.py Outdated Show resolved Hide resolved
Copy link
Member

@cmyui cmyui left a comment

Choose a reason for hiding this comment

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

Adjusted the variable names to not shadow anything - looks like there were actually pre-existing bugs in this regard prior to the PR 😓

Thanks for the contribution! 🎉

@cmyui cmyui force-pushed the sync-cache-db-frozen branch from a890d46 to df26a1b Compare November 29, 2023 00:39
@cmyui cmyui merged commit 3ccce28 into osuAkatsuki:master Nov 29, 2023
3 checks passed
@minisbett minisbett deleted the sync-cache-db-frozen branch February 26, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants