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

Preprocess metadata cache if non-existing (issue #2246) #2249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edwood-grant
Copy link
Contributor

Short summary

This aims to fix #2246

Forcefully deleting the cache will create an odd situation where the app loads the main banner and disappears after a few seconds (probably when the caches have been loaded in the worker thread), leaving the main window in an odd incomplete state.

This change looks up in the FlatpakBackend.vala constructor for the user and system cache metadata folders and will recreate them (via preprocess_metadata) if they are not found.

This will incur in a load time penalty. I believe this is not much of a big deal since this only happen if you explicitly delete the cache folders, which should be a rare occurrence in general.

Tests

Same procedure as set in the bug:

  • Kill App Center
  • Remove in ~/.cache the folders io.elementary.appcenter, flatpak and appstream (you can also simply delete the ~/.cache folder itself.
  • Open App Center

This fix should show the banner and recently updated icons without issue.

Additional info

I believe this is probably the least expensive and more complete solution. There might be a case for just letting the main banner stand and do nothing... but I'm not sure about that. You'd expect all the times to have a fully loaded presentation in the main window, no matter if it's the first time or if you have cleaned your cache.

@edwood-grant edwood-grant changed the title Preprocess metadata on FlatpakBackend constructor if no cache folders… Preprocess metadata cache if non-existing (fix for #2246) Jan 5, 2025
@edwood-grant edwood-grant changed the title Preprocess metadata cache if non-existing (fix for #2246) Preprocess metadata cache if non-existing (issue #2246) Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Appcenter does not recover gracefully from an empty cache
1 participant