“Preparing to Sync” while Syncthing is actually syncing?

Any idea why “Preparing to Sync” shows up as the status message for a folder where a number of deletes are ongoing? Why doesn’t syncthing report “Syncing”?

What exactly do you mean with “deletes are ongoing”? On which device? The one whose GUI you are looking at? How do you tell they are “ongoing”?

I delete 1000 items from device A. I look at the GUI of Device B (a Linux box, viewing the GUI via an iPad browser)

The GUI of device B should say syncing. But it doesn’t. I know it’s deleting because I can see the progress in the file count (via “Local State”). The number of files is decreasing. (As shown in the video.)

I’m a little fuzzy on the details and haven’t checked back in the code. But my guess is that “preparing to sync” actually means it’s processing metadata received from device A. Which in the case of deletions means deleting the files locally.

“Syncing” on the other hand refers to what is called “pulling” internally. That’s the process of requesting and receiving data blocks from remote devices, which are needed to assemble a missing or changed file from remotes.

When a remote announces changes (actively), those are recorded to the local database and reconciled to find a possible source for each data block to pull from (could be another local file as well). That happens during the “Preparing to sync” state. Deleting files locally because of a remote deletion does not require pulling new data blocks, thus it is carried out during this phase as well.

Sorry, didn’t notice that this was a video.

I guess if a set of changes are communicated that include files that need to be pulled, then the pulling happens first and “preparing to sync” becomes “syncing”. And then when the pulling is done and the deletes are still ongoing, then the message remains “syncing” and you get that default 95% completion.

But if there are no Pulls required the status never enters syncing.

In the end it’s functioning fine, but the messaging is weird.

I think it applies all “immediately available changes”, i.e. whose. which don’t need blocks (aka “syncing”) from the peer side: making directories, removing files, making symlinks etc.

It’s a little fuzzy and perhaps badly worded now. “Preparing to sync” is essentially the stage where it figures out the files to sync, the order to sync them in, and builds the queue. I.e., processing file metadata prior to beginning processing of file data. However, it has also evolved to the place where (iirc) directory creates and file renames happen, so there is a certain amount of “syncing” going on here even before it gets into the stage of copying and pulling data blocks.