fix(sync): cache screenshots under the key the app store hands out - #31
Open
martin-rueegg wants to merge 1 commit into
Open
martin-rueegg wants to merge 1 commit into
martin-rueegg wants to merge 1 commit into
Conversation
The app store now serves screenshot URLs already rewritten to point at this proxy. sync.php encoded that proxy URL a second time and fetched the proxy itself, so no screenshot published since the switch was ever fetched, and requests for it answer "File not found". Take the cache key from the proxy URL's path and fetch its decoded form; URLs not in proxy form are handled as before. Assisted-by: Claude Code:Claude Opus 5.5 Signed-off-by: Martin Rüegg <martin.rueegg@metaworx.ch>
Author
|
Direct evidence from the live proxy: files exist under the double-encoded keys, i.e. base64url of the proxy URLs the store hands out. Of 60 random screenshots from today's
Nextcloud instances wrap the store's URL in the proxy a second time too, so their Apps page links to exactly these double keys; that is fixed in nextcloud/server#64771. Both are needed: with only this PR, the instances' previews turn from placeholders into "File not found". |
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.
Since nextcloud/appstore@fd69d12680 the app store stores and serves screenshot URLs already rewritten to
https://usercontent.apps.nextcloud.com/<base64url of the source>.sync.phpstill treats everyurlinapps.jsonas the source: it base64-encodes the proxy URL a second time and fetches the proxy itself. The source image is never fetched, and nothing is written under the key the store links to, so every screenshot URL first published since the store switched answersFile not found. Screenshots cached before the switch keep working, which is why only new apps and new releases are affected.Measured 2026-09-25 against
/api/v1/platform/33.0.0/apps.json:File not found, and they belong to exactly the 18 apps whose newest release is 2026-09-20 or later;The fix takes the cache key from the proxy URL's path and fetches its decoded form. URLs not in proxy form are handled as before. A key that is not base64url is skipped, so the path cannot leave
cache/.Checked: for every screenshot in the current
apps.json, the resolved key equals the path the store links to, and its decoded source is anhttps://URL that re-encodes to the same key.Fixes #27
Fixes #29
Refs #30 (the report is a PDF; same symptom)
Refs nextcloud/appstore#1913 (the screenshot part; its stale-description part is separate)
Not addressed here:
info.xsdallows 256.apps/appstore/lib/Controller/ApiController.phpwraps the (now already proxied) screenshot URL in the proxy again, with plainbase64_encode, so the app management page of a Nextcloud instance links to a key that will never exist.🤖 Generated with Claude Code