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

Copy files to cache instead of using directly. Fixes #178 #219

Merged
merged 2 commits into from
Oct 16, 2020

Conversation

DeKaN
Copy link
Contributor

@DeKaN DeKaN commented Oct 14, 2020

Get InputStream for Uri and write its content to the cache folder instead of trying to get the file.

Checked on Uri's:

content://com.android.providers.media.documents/document/image%3A1017 (Images)
content://com.android.providers.downloads.documents/document/msf%3A1019 (Downloads)
content://com.google.android.apps.docs.storage/document/acc%3D1%3Bdoc%3Dencoded%3DI35Uf5ygTirRhYv9I9zj96uxAsRmXJ5TIy1FrpWs7F%2Fa0pH8BNFolg%3D%3D (Google Drive)
content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F317/ORIGINAL/NONE/image%2Fjpeg/1932874955 (Google Photo)

@aniri
Copy link
Member

aniri commented Oct 16, 2020

@DeKaN hey, thanks for your contribution! It looks good and fixes the bug, there's just a small improvement to be made:

The flow of uploading notes with images is the following:

  • the user writes the note, picks an images and presses the save button
  • if there is an internet connection, the note is sent to the server and also saved locally
  • if there is no internet connection, the note is saved locally
  • the user then does a manual sync and the note is sent to the server

I noticed the delete of the image file from the cache is only done if the internet connection was up when first saving a note and it was sent to the server. But not in the manual sync case. Could you please check and add the delete there also?

Thanks!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aniri
Copy link
Member

aniri commented Oct 16, 2020

@DeKaN awesome 🚀 thank you!

@aniri aniri merged commit de01769 into code4romania:develop Oct 16, 2020
@DeKaN DeKaN deleted the note-files branch October 17, 2020 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants