Modification dates of folders/files are being changed from syncing
Hi, I recently installed and started using Syncthing for the first time, and from the very first sync have experienced critical issues w/ the app destructively editing modification dates of folders, and breaking/rewriting alias files (rather than syncing them) on both computers. I’m using v1.30.0 to sync between 2 MacBook Pros, one using Sequoia 15.6.1 and the other using Catalina 10.15.7, but both issues also happened on the previous 1.29.7 version of Syncthing.
Many folders and a small portion of files that haven’t been opened/edited since well before installing Syncthing have had their modification dates unexpectedly updated by Syncthing to the time of sync, and then moved to the top of the folder above the Syncthing “.stfolder”. This pushes all of the recent folders (w/ accurate mod dates) way down below a long list of very old irrelevant ones (w/ inaccurate mod dates) that have floated to the top. Therefore, if you sort by Date Modified it throws everything out of order, which makes them useless for my purposes.
This prompted me to replace all of these files w/ backup copies just to restore the correct mod dates. Though tedious and time-consuming, initially I thought this would provide a workaround, but the backup copies which now have the dates corrected and matched to the files on the other laptop trigger the exact same issue on it. But there isn’t any discernible pattern that I can see.
Also, if I Stop or Pause All Devices on either laptop, the sync still runs for a while, changing mod dates of folders/files as I watch them in real time float to the top of the parent folder. I have to quit the app in order to get the process to stop right away.
Very surprisingly, 0 issues turn up when I searched this repository for alias or modification date. Considering that an even more critical issue happens during the sync process with rewriting alias files and replacing them with Syncthing text files, it would seem that preventing the app from modifying files that it syncs would solve both issues. I’ll create a separate issue for aliases.
Hi, just checking back on this as it's a critical issue, along with the destructive modification of alias folders/files.
This is by design (see https://docs.syncthing.net/users/faq.html#what-things-are-synced), so not really an issue… This also isn't related to macOS specifically in any way, as directory modification times aren't synchronised by Syncthing under any OS.
Hi, but the link states that file modification times are always synchronized, and this isn’t happening, b/c identical folders/files w/ the same mod dates will often update from the syncing process on only one computer. When file dates change on only one Mac, it makes them unsynchronized.
Since it also occurs w/ some files, I don’t see how the cause of the issue can be related to directory modification times being ignored. For example, a portion of files in certain folders will have the mod dates updated on only one computer as soon as they sync. Additionally, some alias file mod dates will update on only one computer upon opening them (or previewing them w/ the spacebar), and when Syncthing is turned off this never occurs if I test the exact same files.
Not sure what can be going on about the files, but the issue title specifically focuses on folder modification dates, and those not being synchronised is normal. For all the other issues, I would suggest opening a new topic at https://forum.syncthing.net, as they don't seem to be related to the macOS wrapper but rather just Syncthing itself, and you are way more likely to receive help there.
Hi, after reading the FAQ that you linked I understand what you mean about unsynchronized folder mod dates being normal since they are ignored, though the issue happens w/ files too, so the cause is the same and is why I mentioned it (I added “files” to the issue title to reflect this, and edited 2 of my previous comments to clarify it). But are folders supposed to have their mod dates destructively edited from the sync process when no files within them have been edited (and therefore have no updated respective mod dates)? Do you know why it occurs, to what benefit, and why so inconsistently? Here is an example scenario:
Before sync: Folder A’s mod date (Sept 1st) is the same as the most recently edited file in that folder (also Sept 1st).
After sync: Folder A’s mod date unexpectedly changed to the date/time of sync (Oct 1st, 12pm), though the most recent file within it still has a date of Sept 1st, and no changes were made to the corresponding folder or files within it on the other computer.
And it does the same thing with some files too: updates the mod date w/out any changes made to the file, just b/c it was synced at that time.
Thanks for your help, and for the suggestion.
Additionally, the fact that it’s very inconsistent w/ both issues, happening with only some folders/files/aliases rather than all makes it clear that it’s unintentional, and not by design.