cryptomator / cryptomator/android

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

Open
#417 3 comments 0 reactions 0 assignees View on GitHub
type:bug
Dominant language
Kotlin
Stars
1.2k
Forks
216
PR merge metrics
No merged PRs in 30d

Description

### Please agree to the following

- [X] I have searched [existing issues](https://github.com/cryptomator/android/issues?q=) for duplicates
- [X] I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/android/blob/develop/.github/CODE_OF_CONDUCT.md)

### Summary

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

### System Setup

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.