Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Broken download of cached file #156

Open
FrancisDx opened this issue Sep 18, 2024 · 2 comments
Open

[BUG] Broken download of cached file #156

FrancisDx opened this issue Sep 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@FrancisDx
Copy link

📝 Describe the Bug

The file cannot be downloaded if it is loaded from the cache.

📖 Library Version

  • PDF Viewer Version: [2.1.1]

🚶 Steps to Reproduce

Please follow these steps to reproduce the issue:

  1. show pdf from url (PdfViewerActivity.launchPdfFromUrl)
  2. show pdf from url (PdfViewerActivity.launchPdfFromUrl) again (so pdf is loaded instantly from cache)
  3. Unexpected Behavior: on download icon click, file is not asking for a location, but the "File not downloaded yet" toast is shown.
  4. Relevant Code/Stack Trace: Actually the cache path "pdf___cache" is not used, the file is cached to the apps cacheDir.

🤔 Expected Behavior

download from cache as well.

💬 Additional Context

temp workaroud: delete cached pdf before opening PdfViewerActivity:
context?.cacheDir?.listFiles { _, name -> name.endsWith(".pdf") }?.forEach { it.delete() }


@FrancisDx FrancisDx added the bug Something isn't working label Sep 18, 2024
Copy link

Thank you for creating your first issue. We appreciate your help in making this project better. We will look into it, and get back to you soon. Need help or want to discuss this issue? Join our Discord community here to ask questions and discuss this issue live!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@FrancisDx and others