Cache full images when saving attachments - #1671
Merged
Merged
Conversation
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.
What Changed
This PR adds Phase 1 of the full-image attachment cache by making image Save cache-first.
FullImageCachestores decrypted, full-resolution image Blobs by attachment URL in IndexedDB.IndexedDB Changes
liberdus_thumbnailsupgrades from version 1 to version 2 and retains its existingthumbnailsobject store.fullImagesobject store using attachmenturlas its primary key andcachedAtas its only index, matching the thumbnail cache's simple device-shared identity model.Fixed Flow
DOWNLOAD_ATTACHMENTbridge.Why
Saving the same image previously repeated the attachment-server request and decryption every time. Persisting the decrypted full image makes later saves faster and lets a cached image be saved when the attachment server is unavailable. Treating blocked database upgrades as cache failures also keeps Save usable during deployments when an older app tab still owns the previous database connection.
Validation
node --test tests/issue-1656-full-image-cache.test.mjs tests/popup-select-container.test.mjsnode --check app.jsgit diff --check origin/main...issue-1656-save-image-cache-phase1Related to #1656