Skip to content

fix android thumbnail cache invalidation#151

Open
zerox80 wants to merge 2 commits into
opencloud-eu:mainfrom
zerox80:codex/fix-android-thumbnail-cache
Open

fix android thumbnail cache invalidation#151
zerox80 wants to merge 2 commits into
opencloud-eu:mainfrom
zerox80:codex/fix-android-thumbnail-cache

Conversation

@zerox80
Copy link
Copy Markdown
Contributor

@zerox80 zerox80 commented May 9, 2026

summary

this fixes stale thumbnails on android when an image gets replaced but the old cached bitmap is still around.

the thumbnail url now uses a proper cache token order:

explicit etag, then remote etag, then etag, then blank

also updated the android save paths that learn a fresh server etag after download or upload, so they persist it into both etag and remoteEtag.

details

  • keep the existing coil cache setup
  • make remoteEtag the main thumbnail cache token when available
  • save download etags into both local etag fields
  • resolve upload etags with one metadata read if the upload result is blank
  • update existing db rows for content uri uploads instead of inserting folder-list rows
  • preserve a usable remoteEtag when copying files

testing

  • ./gradlew :opencloudApp:testOriginalDebugUnitTest --tests "eu.opencloud.android.presentation.thumbnails.ThumbnailsRequesterTest"
  • ./gradlew :opencloudData:compileDebugAndroidTestKotlin
  • git diff --check

@zerox80 zerox80 marked this pull request as ready for review May 9, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant