{"action":"created","comment":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments/167538102","pull_request_review_id":95770136,"id":167538102,"diff_hunk":"@@ -70,3 +75,62 @@ func (f *sendOnlyFolder) String() string {\n func (f *sendOnlyFolder) PullErrors() []FileError {\n \treturn nil\n }\n+\n+// pull checks need for files that only differ by metadata (no changes on disk)\n+func (f *sendOnlyFolder) pull() {\n+\tselect {\n+\tcase <-f.initialScanFinished:\n+\tdefault:\n+\t\t// Once the initial scan finished, a pull will be scheduled\n+\t\treturn\n+\t}\n+\n+\tf.model.fmut.RLock()\n+\tfolderFiles := f.model.folderFiles[f.folderID]\n+\tignores := f.model.folderIgnores[f.folderID]\n+\tf.model.fmut.RUnlock()\n+\n+\tbatch := make([]protocol.FileInfo, 0, maxBatchSizeFiles)\n+\tbatchSizeBytes := 0\n+\n+\tfolderFiles.WithNeed(protocol.LocalDeviceID, func(intf db.FileIntf) bool {\n+\t\tif len(batch) == maxBatchSizeFiles || batchSizeBytes > maxBatchSizeBytes {\n+\t\t\tf.model.updateLocalsFromPulling(f.folderID, batch)\n+\t\t\tbatch = batch[:0]\n+\t\t\tbatchSizeBytes = 0\n+\t\t}\n+\n+\t\tif ignores.ShouldIgnore(intf.FileName()) {\n+\t\t\tfile := intf.(protocol.FileInfo)\n+\t\t\tfile.Invalidate(f.model.id.Short())\n+\t\t\tbatch = append(batch, file)\n+\t\t\tbatchSizeBytes += file.ProtoSize()\n+\t\t\tl.Debugln(f, \"Handling ignored file\", file)\n+\t\t\treturn true\n+\t\t}\n+\n+\t\tcurFile, ok := f.model.CurrentFolderFile(f.folderID, intf.FileName())\n+\t\tif !ok {\n+\t\t\tif intf.IsDeleted() {\n+\t\t\t\tpanic(\"Should never get a deleted file as needed when we don't have it\")\n+\t\t\t}\n+\t\t\treturn true\n+\t\t}\n+\n+\t\tfile := intf.(protocol.FileInfo)\n+\t\tif curFile.Deleted != intf.IsDeleted() || (!curFile.Deleted && (file.Size != curFile.Size || file.Type != curFile.Type || (!f.ignorePermissions(file) && file.Permissions != curFile.Permissions) || !file.ModTime().Equal(curFile.ModTime()) || !blocksEqual(file.Blocks, curFile.Blocks))) {","path":"lib/model/rofolder.go","position":null,"original_position":67,"commit_id":"d9adcd584ffc983a2acfd607b88cb2c23452112f","original_commit_id":"4ea0ffcb2fa49afd3b5887fa9c2aac7acee33ab8","user":{"login":"imsodin","id":15955093,"avatar_url":"https://avatars0.githubusercontent.com/u/15955093?v=4","gravatar_id":"","url":"https://api.github.com/users/imsodin","html_url":"https://github.com/imsodin","followers_url":"https://api.github.com/users/imsodin/followers","following_url":"https://api.github.com/users/imsodin/following{/other_user}","gists_url":"https://api.github.com/users/imsodin/gists{/gist_id}","starred_url":"https://api.github.com/users/imsodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imsodin/subscriptions","organizations_url":"https://api.github.com/users/imsodin/orgs","repos_url":"https://api.github.com/users/imsodin/repos","events_url":"https://api.github.com/users/imsodin/events{/privacy}","received_events_url":"https://api.github.com/users/imsodin/received_events","type":"User","site_admin":false},"body":"@calmh I went ahead with it, [see this diff](https://github.com/syncthing/syncthing/pull/4750/files/f3409d3a4d05aa5577b8eef638bf8fe6b2ec7727..d9adcd584ffc983a2acfd607b88cb2c23452112f).","created_at":"2018-02-12T12:15:06Z","updated_at":"2018-02-12T12:15:07Z","html_url":"https://github.com/syncthing/syncthing/pull/4750#discussion_r167538102","pull_request_url":"https://api.github.com/repos/syncthing/syncthing/pulls/4750","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments/167538102"},"html":{"href":"https://github.com/syncthing/syncthing/pull/4750#discussion_r167538102"},"pull_request":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/4750"}},"in_reply_to_id":167435350},"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/4750","id":168422106,"html_url":"https://github.com/syncthing/syncthing/pull/4750","diff_url":"https://github.com/syncthing/syncthing/pull/4750.diff","patch_url":"https://github.com/syncthing/syncthing/pull/4750.patch","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/4750","number":4750,"state":"open","locked":false,"title":" lib: Handle metadata changes for send-only folders (fixes #4616, fixes #4627)","user":{"login":"imsodin","id":15955093,"avatar_url":"https://avatars0.githubusercontent.com/u/15955093?v=4","gravatar_id":"","url":"https://api.github.com/users/imsodin","html_url":"https://github.com/imsodin","followers_url":"https://api.github.com/users/imsodin/followers","following_url":"https://api.github.com/users/imsodin/following{/other_user}","gists_url":"https://api.github.com/users/imsodin/gists{/gist_id}","starred_url":"https://api.github.com/users/imsodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imsodin/subscriptions","organizations_url":"https://api.github.com/users/imsodin/orgs","repos_url":"https://api.github.com/users/imsodin/repos","events_url":"https://api.github.com/users/imsodin/events{/privacy}","received_events_url":"https://api.github.com/users/imsodin/received_events","type":"User","site_admin":false},"body":"As promised, this is the followup to #4584, fixing two more bugs. There are two main changes in behaviour:\r\n\r\nThe first one is simple: Send-only folders gain a \"puller\", which is triggered the same way as for the send-receive folder. It checks needed files for ignored files and files, that only differ by internal metadata.  \r\n\r\nThe second one is about unignoring files: Before this PR when a file is unignored, during scanning its version is updated. I.e. the unignored, potentially vastly outdated compared to the global version file is propagated to all other devices. The new behaviour is, that such a file is moved into conflict with the current global file. This is achieved by removing all counters except our own (which was increased) in the version. This obviously has the potential to create a lot of conflict files, but I consider this vastly preferable to silently overwriting the current global state with the previously ignored file.","created_at":"2018-02-10T21:34:47Z","updated_at":"2018-02-12T12:15:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10b9610cd506fe3e662e5f457cd0a2551cdcc88e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/syncthing/syncthing/pulls/4750/commits","review_comments_url":"https://api.github.com/repos/syncthing/syncthing/pulls/4750/comments","review_comment_url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/4750/comments","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/d9adcd584ffc983a2acfd607b88cb2c23452112f","head":{"label":"imsodin:scanDirDel-ign","ref":"scanDirDel-ign","sha":"d9adcd584ffc983a2acfd607b88cb2c23452112f","user":{"login":"imsodin","id":15955093,"avatar_url":"https://avatars0.githubusercontent.com/u/15955093?v=4","gravatar_id":"","url":"https://api.github.com/users/imsodin","html_url":"https://github.com/imsodin","followers_url":"https://api.github.com/users/imsodin/followers","following_url":"https://api.github.com/users/imsodin/following{/other_user}","gists_url":"https://api.github.com/users/imsodin/gists{/gist_id}","starred_url":"https://api.github.com/users/imsodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imsodin/subscriptions","organizations_url":"https://api.github.com/users/imsodin/orgs","repos_url":"https://api.github.com/users/imsodin/repos","events_url":"https://api.github.com/users/imsodin/events{/privacy}","received_events_url":"https://api.github.com/users/imsodin/received_events","type":"User","site_admin":false},"repo":{"id":71178615,"name":"syncthing","full_name":"imsodin/syncthing","owner":{"login":"imsodin","id":15955093,"avatar_url":"https://avatars0.githubusercontent.com/u/15955093?v=4","gravatar_id":"","url":"https://api.github.com/users/imsodin","html_url":"https://github.com/imsodin","followers_url":"https://api.github.com/users/imsodin/followers","following_url":"https://api.github.com/users/imsodin/following{/other_user}","gists_url":"https://api.github.com/users/imsodin/gists{/gist_id}","starred_url":"https://api.github.com/users/imsodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imsodin/subscriptions","organizations_url":"https://api.github.com/users/imsodin/orgs","repos_url":"https://api.github.com/users/imsodin/repos","events_url":"https://api.github.com/users/imsodin/events{/privacy}","received_events_url":"https://api.github.com/users/imsodin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imsodin/syncthing","description":"Open Source Continuous File Synchronization","fork":true,"url":"https://api.github.com/repos/imsodin/syncthing","forks_url":"https://api.github.com/repos/imsodin/syncthing/forks","keys_url":"https://api.github.com/repos/imsodin/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imsodin/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imsodin/syncthing/teams","hooks_url":"https://api.github.com/repos/imsodin/syncthing/hooks","issue_events_url":"https://api.github.com/repos/imsodin/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/imsodin/syncthing/events","assignees_url":"https://api.github.com/repos/imsodin/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/imsodin/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/imsodin/syncthing/tags","blobs_url":"https://api.github.com/repos/imsodin/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imsodin/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imsodin/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/imsodin/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imsodin/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/imsodin/syncthing/languages","stargazers_url":"https://api.github.com/repos/imsodin/syncthing/stargazers","contributors_url":"https://api.github.com/repos/imsodin/syncthing/contributors","subscribers_url":"https://api.github.com/repos/imsodin/syncthing/subscribers","subscription_url":"https://api.github.com/repos/imsodin/syncthing/subscription","commits_url":"https://api.github.com/repos/imsodin/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/imsodin/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/imsodin/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/imsodin/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/imsodin/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/imsodin/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imsodin/syncthing/merges","archive_url":"https://api.github.com/repos/imsodin/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imsodin/syncthing/downloads","issues_url":"https://api.github.com/repos/imsodin/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/imsodin/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/imsodin/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/imsodin/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imsodin/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/imsodin/syncthing/releases{/id}","deployments_url":"https://api.github.com/repos/imsodin/syncthing/deployments","created_at":"2016-10-17T20:31:36Z","updated_at":"2016-10-17T20:31:39Z","pushed_at":"2018-02-12T12:13:10Z","git_url":"git://github.com/imsodin/syncthing.git","ssh_url":"git@github.com:imsodin/syncthing.git","clone_url":"https://github.com/imsodin/syncthing.git","svn_url":"https://github.com/imsodin/syncthing","homepage":"http://forum.syncthing.net/","size":95833,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"syncthing:master","ref":"master","sha":"4955297bf6d473fa8dc3b6dd847770fd233a5012","user":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars0.githubusercontent.com/u/7628018?v=4","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"repo":{"id":14712850,"name":"syncthing","full_name":"syncthing/syncthing","owner":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars0.githubusercontent.com/u/7628018?v=4","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/syncthing/syncthing","description":"Open Source Continuous File Synchronization","fork":false,"url":"https://api.github.com/repos/syncthing/syncthing","forks_url":"https://api.github.com/repos/syncthing/syncthing/forks","keys_url":"https://api.github.com/repos/syncthing/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/syncthing/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/syncthing/syncthing/teams","hooks_url":"https://api.github.com/repos/syncthing/syncthing/hooks","issue_events_url":"https://api.github.com/repos/syncthing/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/syncthing/syncthing/events","assignees_url":"https://api.github.com/repos/syncthing/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/syncthing/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/syncthing/syncthing/tags","blobs_url":"https://api.github.com/repos/syncthing/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/syncthing/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/syncthing/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/syncthing/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/syncthing/syncthing/languages","stargazers_url":"https://api.github.com/repos/syncthing/syncthing/stargazers","contributors_url":"https://api.github.com/repos/syncthing/syncthing/contributors","subscribers_url":"https://api.github.com/repos/syncthing/syncthing/subscribers","subscription_url":"https://api.github.com/repos/syncthing/syncthing/subscription","commits_url":"https://api.github.com/repos/syncthing/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/syncthing/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/syncthing/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/syncthing/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/syncthing/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/syncthing/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/syncthing/syncthing/merges","archive_url":"https://api.github.com/repos/syncthing/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/syncthing/syncthing/downloads","issues_url":"https://api.github.com/repos/syncthing/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/syncthing/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/syncthing/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/syncthing/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/syncthing/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/syncthing/syncthing/releases{/id}","deployments_url":"https://api.github.com/repos/syncthing/syncthing/deployments","created_at":"2013-11-26T09:48:21Z","updated_at":"2018-02-12T12:09:28Z","pushed_at":"2018-02-12T12:13:11Z","git_url":"git://github.com/syncthing/syncthing.git","ssh_url":"git@github.com:syncthing/syncthing.git","clone_url":"https://github.com/syncthing/syncthing.git","svn_url":"https://github.com/syncthing/syncthing","homepage":"https://forum.syncthing.net/","size":94148,"stargazers_count":19385,"watchers_count":19385,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1640,"mirror_url":null,"archived":false,"open_issues_count":233,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":1640,"open_issues":233,"watchers":19385,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/4750"},"html":{"href":"https://github.com/syncthing/syncthing/pull/4750"},"issue":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/4750"},"comments":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/4750/comments"},"review_comments":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/4750/comments"},"review_comment":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/4750/commits"},"statuses":{"href":"https://api.github.com/repos/syncthing/syncthing/statuses/d9adcd584ffc983a2acfd607b88cb2c23452112f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"imsodin"}}