Skip to content

Comments

[mob][locker] Cache encrypted files and harden download/open paths#9144

Merged
ua741 merged 2 commits intoente-io:mainfrom
neeraj-pilot:locker_path
Feb 24, 2026
Merged

[mob][locker] Cache encrypted files and harden download/open paths#9144
ua741 merged 2 commits intoente-io:mainfrom
neeraj-pilot:locker_path

Conversation

@neeraj-pilot
Copy link
Contributor

@neeraj-pilot neeraj-pilot commented Feb 11, 2026

Summary

  • switch file-open caching to encrypted blobs keyed by uploadedFileID
  • persist encrypted cache only after successful decryption
  • add decrypted cache files keyed by uploadedFileID and reuse them on open
  • avoid decrypted temp file collisions by including uploadedFileID in non-cache output filename
  • make resumable download manager recover when a stale completed temp file is missing
  • clear locker cache directory contents as the last step during logout

Why

  • stop relying on filename-based cache keys
  • reduce redundant decrypt work on repeated opens
  • fix failure to re-open large files after logout/login in the same app session
  • prevent same-name file conflicts during repeated/overlapping open or download flows

Behavioral changes

  • open flow now checks ID-keyed decrypted cache first
  • if decrypted cache is missing, open flow reuses cached encrypted data (cache/<uploadedFileID>.encrypted) and decrypts
  • decrypted cache path is ID-keyed (cache/<uploadedFileID>.decrypted<ext>), not displayName-keyed
  • logout removes both encrypted and decrypted cache files

Validation

  • flutter analyze lib/services/configuration.dart lib/services/files/download/file_downloader.dart lib/services/files/download/manager.dart lib/utils/file_util.dart
  • analyzer reports no issues

- cache encrypted files by uploaded file id and only persist after successful decryption\n- avoid decrypted temp path collisions by using uploaded file id in output filename\n- make DownloadManager restart large downloads when stale completed files are missing\n- clear locker cache directory contents as the final logout step
- add ID-keyed decrypted cache path helper\n- reuse decrypted cache on open if already present\n- keep encrypted cache fallback and download/decrypt flow unchanged\n- keep logout cache cleanup as final step
@ua741 ua741 changed the title locker: cache encrypted files and harden download/open paths [mob][locker] Cache encrypted files and harden download/open paths Feb 24, 2026
@ua741 ua741 merged commit 36b338c into ente-io:main Feb 24, 2026
4 checks passed
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.

2 participants