appstore icon indicating copy to clipboard operation
appstore copied to clipboard

Clear cache after app release deletion

Open tcitworld opened this issue 1 month ago • 4 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. upload an app release
  2. delete an app release through API
  3. notice the app release is still provided in apps.json endpoint and web view

Expected behaviour

Cache should be cleared when an app release is deleted, just as when a new one is being created

Actual behaviour

There's a ~30 minutes cache before the change is visible

tcitworld avatar Nov 26 '25 10:11 tcitworld

Hi, just confirming if this issue is resolved for you already before I close this. Most likely, this is due to a separate caching mechanism in https://apps.nextcloud.com/ that is outside of the project's control.

edward-ly avatar Dec 02 '25 08:12 edward-ly

I don't think this is related to the apps.nextcloud.com specific server deployment as the cache is correctly cleared when a new app release is created, but not when it's deleted.

tcitworld avatar Dec 02 '25 09:12 tcitworld

I searched through the code and couldn't find any issues with the functions in question:

https://github.com/nextcloud/appstore/blob/aab47bb4232a74723e4494a2b28842dda05a4c8a/nextcloudappstore/api/v1/urls.py#L44

https://github.com/nextcloud/appstore/blob/aab47bb4232a74723e4494a2b28842dda05a4c8a/nextcloudappstore/core/caching.py#L60-L75

These both calculate the date/time of either the last uploaded release or last deleted release, whichever is more recent, so there shouldn't be any difference when creating or deleting a release. I can also confirm that the logging of deleted app releases in AppReleaseDeleteLog is working correctly too.

@SystemKeeper @nickvergessen Any thoughts? Do you think it's possible to invalidate the cache on your end too whenever a release is created or deleted?

edward-ly avatar Dec 03 '25 06:12 edward-ly

I don't think this is related to the apps.nextcloud.com specific server deployment as the cache is correctly cleared when a new app release is created, but not when it's deleted.

This might have been a coincidence, the current caching infrastructure does not take new/deleted releases into account. And yes, it can take up to 30 min for everything to be updated. Also please keep in mind that the instances itself also cache the apps.json response and is completely outside of server side handling.

This would need some thinking (if required), I don’t have a quick solution for this in my head.

SystemKeeper avatar Dec 03 '25 06:12 SystemKeeper