{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/1677","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/1677/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/1677/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/1677/events","html_url":"https://github.com/syncthing/syncthing/issues/1677","id":69865537,"number":1677,"title":"Tracking moved/renamed/deleted files/folders","user":{"login":"3three","id":11271108,"avatar_url":"https://avatars.githubusercontent.com/u/11271108?v=3","gravatar_id":"","url":"https://api.github.com/users/3three","html_url":"https://github.com/3three","followers_url":"https://api.github.com/users/3three/followers","following_url":"https://api.github.com/users/3three/following{/other_user}","gists_url":"https://api.github.com/users/3three/gists{/gist_id}","starred_url":"https://api.github.com/users/3three/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3three/subscriptions","organizations_url":"https://api.github.com/users/3three/orgs","repos_url":"https://api.github.com/users/3three/repos","events_url":"https://api.github.com/users/3three/events{/privacy}","received_events_url":"https://api.github.com/users/3three/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-21T14:43:33Z","updated_at":"2015-04-24T00:37:52Z","closed_at":null,"body":"(Apologies if this has already been discussed, I've tried to understand Syncthing, but I don't quite have my head wrapped around how it work just yet.)\r\n\r\nI work in an office with ~25 computers, some are laptops which are often disconnected from the network/internet for days at a time before reconnecting. My colleagues are not at all technical and do strange things with their files all the time.\r\n\r\nThere are a number of problems we've seen with Bittorrent Sync (which we're hoping to scrap when Syncthing v1.0 comes out), which seem to share a common origin: Deletions don't seem to be properly tracked.\r\n\r\n### Scenario 1: Simple deletion\r\nFile/folder is deleted, computers currently online all sync up, then later a laptop rejoins the network and adds the deleted file/folder back again. Unless we can get ALL of our computers onto the network syncing all at the same time (which we should assume is never), we will have zombie files/folders that keep reappearing and just won't die.\r\n\r\n### Scenario 2: Simple rename/move of a file/folder\r\nThis is equivalent to a delete old + add new. It suffers the exact same problem as above, but additionally needs the entire folder to be copied again (I understand this is because it's impossible(?) to know the difference between a \"move\" and a \"delete + add\").\r\n\r\n### Scenario 3: The Marjorie Manouevre\r\nNamed after the colleague who did it, it's where she needed to update a file with new info, then save it under a different name (the filename contains the date of modification, which is fine, I don't care). What she did was:\r\n1. Modify the file and save it\r\n2. Rename the file\r\nThis created a problem, because the first modification started to sync through the network, when the file was effectively deleted and added under a new name. The old file then appeared again later. I don't know if it was the modified version or not, because although the computers' clocks are synced, the timestamps aren't necessarily 100% accurate.\r\n\r\nIdeally, it would be nice for every file to have its own unique identifier (perhaps a filesize + CRC hash), which would remain the same regardless of renaming/moving and stored in a database (the .sync directory?) to keep track of deletions.\r\n\r\nReally, it makes sense for it to work like Git itself, but where push/pulls are done in real-time and fast-forward merges are done automatically.\r\n\r\nThanks for building Syncthing. I'm excited for it to reach v1.0!"},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/95763214","html_url":"https://github.com/syncthing/syncthing/issues/1677#issuecomment-95763214","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/1677","id":95763214,"user":{"login":"ultravioletnanokitty","id":1589610,"avatar_url":"https://avatars.githubusercontent.com/u/1589610?v=3","gravatar_id":"","url":"https://api.github.com/users/ultravioletnanokitty","html_url":"https://github.com/ultravioletnanokitty","followers_url":"https://api.github.com/users/ultravioletnanokitty/followers","following_url":"https://api.github.com/users/ultravioletnanokitty/following{/other_user}","gists_url":"https://api.github.com/users/ultravioletnanokitty/gists{/gist_id}","starred_url":"https://api.github.com/users/ultravioletnanokitty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ultravioletnanokitty/subscriptions","organizations_url":"https://api.github.com/users/ultravioletnanokitty/orgs","repos_url":"https://api.github.com/users/ultravioletnanokitty/repos","events_url":"https://api.github.com/users/ultravioletnanokitty/events{/privacy}","received_events_url":"https://api.github.com/users/ultravioletnanokitty/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T00:37:52Z","updated_at":"2015-04-24T00:37:52Z","body":"in my experience, syncthing is particularly bad at dealing with a synced folder being completely reorganised. for example, i'm currently rearranging and cleaning up my images folder (with many subdirectories), which is synced between only two nodes (my laptop and desktop). as the folder had gotten very messy, i've been moving folders and hundreds of individual files around, but not removing more than a few individual files. if i move, say, a folder containing ~500 images into a new subfolder, syncthing completely fails to notice how simple the change really was. instead, it immediately tells me that <size of folder> is out of sync, and spends far too long (on the order of 15+ minutes) reconciling the changes. luckily, it does seem to check itself locally before wasting network bandwidth by re-transferring the files, but the amount of time it takes to re-verify the exact same data in a new folder is ridiculous. if it makes a difference, i am using the syncthing-inotify extension. the same behaviour occurs if i run syncthing without the wrapper, however, so i don't think it's an issue.\r\n\r\nmy suggestions: use the native inotify support that's supposedly coming (or another method, if deemed superior) to track when files and entire directories are moved, as opposed to deleted. implement a means of informing other nodes that those files/directories only need to be relocated, so that nodes don't spend forever rearranging files one-at-a-time."}}