samschott / maestral

Open-source Dropbox client for macOS and Linux
https://maestral.app
MIT License
3.1k stars 65 forks source link

Fix zero byte files #945

Closed samschott closed 1 year ago

samschott commented 1 year ago

Fixes an issue where data transport errors that are retried could result in zero byte files being created in the cloud if the local file size is smaller than 4 MB. This is caused by not rewinding to the beginning of the file before retrying the upload.

Note that chunked uploads for files > 4 MB are already handled correctly.

Fixes #925 and #926.

codecov[bot] commented 1 year ago

Codecov Report

Merging #945 (8683f08) into main (ce1b4b4) will increase coverage by 19.56%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main     #945       +/-   ##
===========================================
+ Coverage   59.01%   78.57%   +19.56%     
===========================================
  Files          42       42               
  Lines        7502     7506        +4     
===========================================
+ Hits         4427     5898     +1471     
+ Misses       3075     1608     -1467     
Flag Coverage Δ
pytest 78.57% <100.00%> (+19.56%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/maestral/client.py 84.00% <100.00%> (+6.90%) :arrow_up:

... and 15 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

JNGRichardson commented 1 month ago

Hope it's OK to comment here too (I'm new to GitHub, so not sure about etiquette). I'm not sure this issue has been fully fixed — I've been experiencing #925 in the latest versions, and several times since this fix. I've posted logs in my comment here: https://github.com/samschott/maestral/issues/925#issuecomment-2271967043