feat(appstore): use bounded stale cache when refresh fails - #63141
Draft
joshtrichards wants to merge 5 commits into
Draft
feat(appstore): use bounded stale cache when refresh fails#63141joshtrichards wants to merge 5 commits into
joshtrichards wants to merge 5 commits into
Conversation
Fall back to stale but otherwise valid, same-version App Store cache data when a refresh fails, provided it is no older than seven days. Continue accepting valid empty responses as fresh data while rejecting missing, incompatible, or overly stale cache entries. Improves the user experience by preserving access to App Store metadata during temporary retrieval failures, allowing users to continue browsing the App Store. Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Verify that same-version cached data is used after refresh failures while within the seven-day stale limit, rejected after the limit, and returned during the recent-failure cooldown. Also verify that valid empty refresh responses replace stale data. Signed-off-by: Josh <josh.t.richards@gmail.com>
Verify that stale app data still respects the App Store allowlist. Signed-off-by: Josh <josh.t.richards@gmail.com>
Verify that stale discover data still removes expired entries after the base fetcher falls back from a failed refresh. Assisted-by: Copilot:gpt-5.6-luna Signed-off-by: Josh <josh.t.richards@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This preserves access to (slightly stale) App Store metadata during temporary retrieval failures while preventing indefinitely stale or incompatible data from being used. This might also diminish need to use #55420 in some environments,
Before this change, a failed refresh returned an empty result even when a valid cached response was available. Now, we fall back to valid, same-version App Store cache data when refreshing the App Store fails, provided the cached data is no older than seven days:
[][]data: [][]and do not refresh the cache[][][][][][]This improves resilience during temporary App Store or network failures without allowing indefinitely stale or incompatible metadata to be used.
Changes:
AppFetcherallowlist filtering;AppDiscoverFetcherexpiry filtering.User impact
Temporary App Store or network failures no longer cause App Store browsing and metadata consumers to immediately receive an empty result when usable cached metadata is available.
For example, if the App Store endpoint is temporarily unavailable while an instance has a six-day-old cache for its current Nextcloud version, users can continue browsing the cached App Store metadata. If the cache is more than seven days old, or belongs to another Nextcloud version, the fetcher still returns an empty result rather than presenting potentially misleading data.
Testing
AppFetcherandAppDiscoverFetcher.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)