Repository navigation
fix(images): clear the image cache on sign-out - #110
Merged
simonhamp merged 1 commit intoOct 28, 2026
Merged
Conversation
Account::forget() emptied the response cache, the stash and the outbox, but left storage/app/image-cache alone. Pruning only runs in the first download of a later launch, and nothing downloads once you are signed out, so the images the last person saw (avatars, commit images, link previews) stayed on the phone indefinitely. Sign-out now deletes the folder and forgets what each URL was drawn from, so nothing points at a deleted file. A download already running on a background thread checks that someone is still signed in before it writes, so it can't put images back after the folder is gone. 🤖 Généré avec Claude Code
jubianchi
marked this pull request as ready for review
October 27, 2026 23:16
Member
|
good call |
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.
Found while reviewing the app bundled in the iOS 1.0.2 TestFlight build.
Account::forget()empties the response cache, the stash and the outbox, but notstorage/app/image-cache. Old images are only pruned by the firstDownloadImagestask of a later launch, and nothing downloads once you're signed out. So the avatars, commit images and link preview images the last person saw (Remotes ones included) stayed on the phone indefinitely. It might be intentional for some images (the ones from the log because they are public) but not those from Remotes.ImageCache::clear()deletes the folder and forgets what each URL was drawn from this launch, so nothing points at a deleted file.Account::forget()calls it next toResponseCache::flush().DownloadImages::save()checks that someone is still signed in after each batch arrives and before writing it, so a download already running on a background thread can't put images back once the folder is gone. The cache store is the shared SQLite database, so the background thread sees the sign-out. I chose this over a per-user folder (image-cache/{userId}), which would touch every path inImageCachefor little gain once the folder is cleared on sign-out.Tests
save()keeps nothing when nobody is signed in.Screenshots
🤖 Generated with Claude Code