Skip to content

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
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