Repository navigation
fix(thumbnails): never thumbnail files inside the shared thumbnail cache - #2032
Merged
Merged
Conversation
Browsing $XDG_CACHE_HOME/thumbnails stored a thumbnail for every cache entry, which in turn became a new entry, so the directory grew without bound until the user left it. Files anywhere under the thumbnails tree are now excluded from both disk lookup and store, checked against the lexical and the resolved paths so a symlinked cache or entry cannot slip through.
This was referenced Nov 2, 2026
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.
Description
Browsing
~/.cache/thumbnailsmade Strata render a thumbnail for every cache entry and store it back into the same cache, so each new entry became another file to thumbnail and the directory grew without bound until the user navigated away.thumbnail_cache::storeandthumbnail_cache::lookupnow refuse any path under the sharedthumbnailstree (the parent of thelargebucket). Both the lexical path and the resolved path are checked, so a symlinked cache directory or a symlinked entry does not bypass the guard. Entries in the cache are still rendered in memory, so the browser keeps showing them as images; they are just never persisted. A sibling directory such asthumbnails-oldis unaffected.A regression test covers an entry inside
large, an entry in a sibling bucket, an entry reached through a symlink to the cache root, and a look-alike directory outside the tree.docs/preview-sandbox.mdrecords the behaviour.Visual evidence
N/A. The change prevents files from being written; nothing visible changes in the browser.
How to test
~/.cache/thumbnails/largeand wait a few seconds.watch ls ~/.cache/thumbnails/large | wc -l.Expected result: The entry count stays constant while browsing the cache, and the PNGs still display as image thumbnails. Before this change the count kept growing until the directory was left.
Related issue
Closes #2031