cryptomator / android

Cryptomator for Android
https://cryptomator.org
GNU General Public License v3.0
739 stars 123 forks source link

Big .xlsx file results in 0byte file when edited with Google Sheets #417

Open SailReal opened 2 years ago

SailReal commented 2 years ago

Please agree to the following

Summary

If I edit a big .xlsx file using Google Sheets and resume Cryptomator, a 0byte file is uploaded

System Setup

- Android: x
- Cryptomator: 1.6.8

Cloud Type

No response

Steps to Reproduce

  1. Create a big .xlsx file (Writer using .docx should be affected as well), I tested with 6MB
  2. Store it in a vault
  3. Open it using Google Sheets
  4. Change something
  5. Click back to return to Cryptomator

Expected Behavior

Cryptomator gets resumed and uploads the new content

Actual Behavior

The file stored in the cloud gets overwritten with 0byte (empty .xlsx file)

https://user-images.githubusercontent.com/1786772/154507623-65a648af-ba62-4110-83cb-545d497349b2.mp4

Reproducibility

Always

Relevant Log Output

No response

Anything else?

We tried to workaround this bug in the Google apps by sleeping for 500ms after Cryptomator gets resumed before accessing the shared content:

https://github.com/cryptomator/android/blob/71dc76b1575acc3b33cb98b63f19893fae1e1d30/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt#L1178-L1183

This works for smaller files, but not for larger ones where google obviously takes even longer to write the file. That Google already closes the app and saves it in the background is quite unwise. If I increase the timeout from 500ms to e.g. 5000ms the file isn't empty anymore but setting the timeout generally to 5 seconds isn't a solution especially since there are sure to be problems again with even larger files.:

https://user-images.githubusercontent.com/1786772/154507660-48144b98-cccf-4ff3-ae06-cd3368873d23.mp4

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.