Skip to content

During scanning, there is incorrect 0% suffix being shown on label #8331

Open

Description

@rdslw
  • Problem is visibile on both syncthing 1.19.1 and syncthing 1.20.1 - I dont know about earlier releases.
  • Firefox 100
  • Problem description:
    During scanning the "Scanning" label has also "0%" suffix being shown which is incorrect/misleading. AFAIK this 0% does not apply to scanning. There is never anything bigger than 0% on scanning. Also sometimes there is just "Scanning"

I would expect that either Scanning never shows 0%, only "Scanning", or the percentage increases as folder is being scanned.

To reproduce it, you need to have folder with big number of files (100k+) as for small one label changeing is too fast to notice.

Activity

  1. added
    bug
    needs-triage
    on May 8, 2022
  2. tomasz1986 commented on May 8, 2022

    @tomasz1986
    Member

    I can confirm the "0%" problem. Scanning seems to show the actual percentage only when going through new files, but if you rescan already existing ones, it just says "Scanning" with no percentage or, not sure when exactly though, it sometimes gets stuck at "Scanning (0%)".

  3. removed
    needs-triage
    on May 8, 2022
  4. calmh commented on May 8, 2022

    @calmh
    Member

    scanProgressIntervalS?

    Every scan has two phases.

    • no percentage => looking for changed files
    • percentage => started hashing changed files
  5. tomasz1986 commented on May 8, 2022

    @tomasz1986
    Member

    scanProgressIntervalS

    Set to the default value of 0 (meaning 2 seconds). I've just managed to reproduce the issue.

    1. Set up a shared folder with quite a large number of files between two devices.

    2. On Device 2, pause all folders, then restart Syncthing (to clear cache).

    3. On Device 1, make a change in the folder while it's still paused on Device 2.

    4. On Device 2, unpause the folder.

    5. Firstly, the label says only "Scanning", but then it changes to "Scanning (0%)", and it stays like that for ~5 seconds.

      image

    6. Next, the label for a very brief moment changes to "Out of Sync", which then immediately changes into "Up to Date".

      image

    I'm not sure what exactly is going on behind the scenes, but as it looks in the GUI, the label seems to change directly from "Scanning" to "Scanning (0%)", and then straight into "Out of Sync", and only then into "Up to Date". It also sits at "Scanning (0%)" for at least a few seconds even if there's nothing new to hash (e.g. when syncing a deletion). The percentage itself is stuck at "0%" all the time.

  6. calmh commented on May 8, 2022

    @calmh
    Member

    So there was nothing to hash, and it's taking a few seconds to finish up that phase (looking for deleted files) and emitting events to the GUI. This seems like an insignificant UI detail. It could say "100%" for those few seconds as well, but I guess that would also be wrong because it's still doing something?

  7. tomasz1986 commented on May 8, 2022

    @tomasz1986
    Member

    Just curious, how is the percentage calculated here exactly? Let's say, we've added 5 new files to the folder. When hashing the first file, will it be calculated out of the 5 newly added files (i.e. 20%) or out of the total number of files in the folder? If it's the latter, then this may be the reason why it always stays at 0%, since it's usually just a few files out of 10,000 or similar.

    Of course, I haven't really examined the code, so I may be completely wrong.

  8. calmh commented on May 8, 2022

    @calmh
    Member

    Bytes scanned out of bytes to scan.

    $scope.scanPercentage = function (folder) {
    if (!$scope.scanProgress[folder]) {
    return undefined;
    }
    var pct = 100 * $scope.scanProgress[folder].current / $scope.scanProgress[folder].total;
    return Math.floor(pct);
    };

  9. rdslw commented on May 9, 2022

    @rdslw
    Author

    On my (slow) machines, with big folders (read hours of scanning(*)), I never saw any value different than 0% on Scanning. Either just "Scanning" either "Scanning (0%)". If changing to match actuall progress is difficult I suggest to ditch the number as it's misleading.

    Option scanProgressIntervalS is at 0 (default).

    (*) it was few dozens of hours (+1 day) of scanning due to highly ineffective CaseSensitivity check, which also being executed on Scanning, after disabling it, Scanning takes around 11 minutes on that machine. but thats another story :)

  10. added theissue type on May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions