-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Dinamically load icons if cache is being rebuilt (issue #2209) #2238
base: main
Are you sure you want to change the base?
Dinamically load icons if cache is being rebuilt (issue #2209) #2238
Conversation
…ith a borken icon. This also attmepts to load all available icons, including flatpak emote icons via priority according to freedekstop specs.
…rify cache existence). Also removing a not needed critical message
…d icon. Then, change it to the correct icon when you are sure its correspondent cahce remote has been updated properly. This happens aof Banner icons, ListPackageRowGrid icons, and AppInfoView Icons
blocking method. Also, ensure no spinner shows when an icon is not available (instead of failing to load icon)
I think it's a great solution, but I'm not sure if we should use |
So I implemented the I suppose the I also decided to blur and desaturate the default icon a bit via CSS, to avoid confusion if an actual icon cannot be found, so those use the normal default icons (at the moment some flatpaks that use remote icons only have no icon on the AppCenter because we are not dynamically downloading remote icons yet.) Here is the result: 2025-01-03.18-06-47.mp4Let me know what you think 👍 Edit: I made some change to removed using named |
I feel stupid for asking this, but how would it be best to test this out ? when testing this branch, deleting the appstream or flatpak, or both, folders in cache, it appears fully loaded, no temporary icon or anything. deleting io.elementary.appcenter only causes #2246 |
Hey @teamcons. So yeah, it's a bit annoying to test this. The "real test" is to, literally, wait for one hour after opening the AppCenter and closing it. The cache gets invalidated after one hour, so that's how you should test it "for real". But if you want to do the quick check, you can modify the You can put a small value, like 30, so the cache gets invalidated every 30 seconds or something like that (so you can test that a reload of the AppCenter should not trigger this behavior in between the invalidation timer because the cache is OK). You can also put 0, and it will always invalidate. In theory, both tests should yield the same results, as the only difference is the AppCenter Flatpak backend defined time for the cache to be invalid. If you have more questions, let me know 👍 |
I mean i cam retry, but that is also how ive proceeded a few times, waiting some time before reopening appcenter, and the behaviour is similar - probably it loads too fast ? |
Short summary
This aims to fix #2209
What I've found is that are some methods that will temporarily erase the cached icons folder in order to repopulate. This happens:
The method in question is
preprocess_metadata
. This, for every user and system remote, delete s its cache folder, and checks for the integrity of everything before re-creating the folder icons symbolics links again.Given some discussion, the conclusion was that it was best to add a signal to detect as soon as possible that each remote manages to update itself and then update the corresponding icon accordingly. The aforementioned icons now use the default icon if it fails to
This PR also addresses the icon load procedure in
Package.vala
, in order to have priority on the recommended icons to load according to the AppStream API. The order in question is:Right now, we are not loading remote icons because of a blocking event when querying the URI. I think it's perfectly possible to dynamically load these, similarly to when the cache is being rebuilt. Worthy of a future PR. This change should be a basic preparation for that.
Tests
Here are some videos of the results. Note that I'm using for some of these fake cache times, just to show stuff.
This video tests loading icons for the first time. Then it reloads to show that, if cache is good, won't load them up again.
2025-01-02-01.13.16.723112574.mp4
This one shows that if you quickly go to the
AppInfoView
, the loading icon event can still be seen.2025-01-02-01.13.59.877832494.mp4
Additional info
Sorry about the commit history being a bit polluted, I was doing and undoing stuff. If you need me to squash some commits, I can do that.