Infomaniak / desktop-kDrive

:computer: Desktop Syncing Client for kDrive
GNU General Public License v3.0
19 stars 4 forks source link

KDESKTOP-1019-macOS-LiteSync-File-deleted-if-app-restarted-during-upload #207

Closed ClementKunz closed 1 month ago

ClementKunz commented 2 months ago

Several changes have been implemented to avoid the Delete operations described in KDESKTOP-1019:

  1. We do not delete dehydrated placeholders that the app tried to upload. Instead, we rename them appending the "blacklisted" suffix, so that they are excluded from sync.
  2. We do not set a status to a file which is being uploaded. Therefore, in the Finder, the files will not have any statuses until the end of the upload.
  3. Finally, we reinforce the detection of dehydrated placeholders by also retrieving the number of memory blocks used that is the number st_blocks obtained from the call to lstat. Therefore, a placeholder is considered dehydrated only if this number is 0. Finally, the use of st_blocks was misleading for files with thumbnails. Indeed, dehydrated placeholder with a thumbnail has a st_blocks value higher than 0.
sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud