chore: stop treating dirs as having size 128 (#10750)

Resp. directories for the database, and both dirs and symlinks for
`FileInfo.FileSize`. Instead handle it in the UI progress percentage. We
even already have special cases there for deletions, might as well
handle directories just like any other zero-sized needed item there.

This went through the very thorough testing of running it on my laptop,
the migration was applied and it seemed to be working fine after.

---------

Signed-off-by: Simon Frei <freisim93@gmail.com>
This commit is contained in:
Simon Frei
2026-06-22 20:32:03 +02:00
committed by GitHub
parent 5313c75eba
commit c9236b1adc
12 changed files with 44 additions and 41 deletions
@@ -1139,20 +1139,20 @@ angular.module('syncthing.core')
};
$scope.syncPercentage = function (folder) {
if (typeof $scope.model[folder] === 'undefined') {
var model = $scope.model[folder];
if (typeof model === 'undefined') {
return 100;
}
if ($scope.model[folder].needTotalItems === 0) {
if (model.needTotalItems === 0) {
return 100;
}
if (($scope.model[folder].needBytes == 0 && $scope.model[folder].needDeletes > 0) || $scope.model[folder].globalBytes == 0) {
// We don't need any data, but we have deletes that we need
// to do. Drop down the completion percentage to indicate
// that we have stuff to do.
// Do the same thing in case we only have zero byte files to sync.
if (model.needBytes == 0 && model.needTotalItems > 0) {
// We don't need any data, but we have deletes, directories,
// symlinks or zero byte files that we need to do. Drop down the
// completion percentage to indicate that we have stuff to do.
return 95;
}
return progressIntegerPercentage($scope.model[folder].inSyncBytes, $scope.model[folder].globalBytes);
return progressIntegerPercentage(model.inSyncBytes, model.globalBytes);
};
$scope.scanPercentage = function (folder) {