{"action":"created","comment":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments/42555610","id":42555610,"diff_hunk":"@@ -314,12 +318,17 @@ func ldbUpdate(db *leveldb.DB, folder, device []byte, fs []protocol.FileInfo) in\n \n \tvar maxLocalVer int64\n \tvar fk []byte\n+\tlocalDev := isLocalDevice(device)\n \tfor _, f := range fs {\n \t\tname := []byte(f.Name)\n \t\tfk = deviceKeyInto(fk[:cap(fk)], folder, device, name)\n \t\tl.Debugf(\"snap.Get %p %x\", snap, fk)\n \t\tbs, err := snap.Get(fk, nil)\n \t\tif err == leveldb.ErrNotFound {\n+\t\t\tif localDev {\n+\t\t\t\tsize.addFile(f)","path":"lib/db/leveldb.go","position":32,"original_position":32,"commit_id":"a6db0be01e4894415fbbf6b0c8d6da0deb4bee22","original_commit_id":"a6db0be01e4894415fbbf6b0c8d6da0deb4bee22","user":{"login":"AudriusButkevicius","id":1144861,"avatar_url":"https://avatars.githubusercontent.com/u/1144861?v=3","gravatar_id":"","url":"https://api.github.com/users/AudriusButkevicius","html_url":"https://github.com/AudriusButkevicius","followers_url":"https://api.github.com/users/AudriusButkevicius/followers","following_url":"https://api.github.com/users/AudriusButkevicius/following{/other_user}","gists_url":"https://api.github.com/users/AudriusButkevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudriusButkevicius/subscriptions","organizations_url":"https://api.github.com/users/AudriusButkevicius/orgs","repos_url":"https://api.github.com/users/AudriusButkevicius/repos","events_url":"https://api.github.com/users/AudriusButkevicius/events{/privacy}","received_events_url":"https://api.github.com/users/AudriusButkevicius/received_events","type":"User","site_admin":false},"body":"Do we not care about f.IsInvalid etc?","created_at":"2015-10-20T21:16:03Z","updated_at":"2015-10-20T21:16:03Z","html_url":"https://github.com/syncthing/syncthing/pull/2397#discussion_r42555610","pull_request_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2397","_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments/42555610"},"html":{"href":"https://github.com/syncthing/syncthing/pull/2397#discussion_r42555610"},"pull_request":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2397"}}},"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/2397","id":48204606,"html_url":"https://github.com/syncthing/syncthing/pull/2397","diff_url":"https://github.com/syncthing/syncthing/pull/2397.diff","patch_url":"https://github.com/syncthing/syncthing/pull/2397.patch","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2397","number":2397,"state":"open","locked":false,"title":"Keep LocalSize data in RAM","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"body":"This keeps LocalSize in RAM for instant querying, saving us having to walk the database to get it. The local size is fairly easy to track, as we have all the info we need in the ldbUpdate() method. The global size stuff is trickier...","created_at":"2015-10-20T14:02:00Z","updated_at":"2015-10-20T21:16:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73447b12f1ecd5072621098087d1c97eb342141e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2397/commits","review_comments_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2397/comments","review_comment_url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2397/comments","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/a6db0be01e4894415fbbf6b0c8d6da0deb4bee22","head":{"label":"calmh:localsize","ref":"localsize","sha":"a6db0be01e4894415fbbf6b0c8d6da0deb4bee22","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"repo":{"id":29292392,"name":"syncthing","full_name":"calmh/syncthing","owner":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calmh/syncthing","description":"This is my personal fork of the repo, not the official one! It may be outdated, broken, rebased upon and generally screwed around with. Don't watch it, star it, or fork from it! :)","fork":true,"url":"https://api.github.com/repos/calmh/syncthing","forks_url":"https://api.github.com/repos/calmh/syncthing/forks","keys_url":"https://api.github.com/repos/calmh/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calmh/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calmh/syncthing/teams","hooks_url":"https://api.github.com/repos/calmh/syncthing/hooks","issue_events_url":"https://api.github.com/repos/calmh/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/calmh/syncthing/events","assignees_url":"https://api.github.com/repos/calmh/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/calmh/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/calmh/syncthing/tags","blobs_url":"https://api.github.com/repos/calmh/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calmh/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calmh/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/calmh/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calmh/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/calmh/syncthing/languages","stargazers_url":"https://api.github.com/repos/calmh/syncthing/stargazers","contributors_url":"https://api.github.com/repos/calmh/syncthing/contributors","subscribers_url":"https://api.github.com/repos/calmh/syncthing/subscribers","subscription_url":"https://api.github.com/repos/calmh/syncthing/subscription","commits_url":"https://api.github.com/repos/calmh/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/calmh/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/calmh/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/calmh/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/calmh/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/calmh/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calmh/syncthing/merges","archive_url":"https://api.github.com/repos/calmh/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calmh/syncthing/downloads","issues_url":"https://api.github.com/repos/calmh/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/calmh/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/calmh/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/calmh/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calmh/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/calmh/syncthing/releases{/id}","created_at":"2015-01-15T10:31:42Z","updated_at":"2015-10-11T11:56:51Z","pushed_at":"2015-10-20T16:26:46Z","git_url":"git://github.com/calmh/syncthing.git","ssh_url":"git@github.com:calmh/syncthing.git","clone_url":"https://github.com/calmh/syncthing.git","svn_url":"https://github.com/calmh/syncthing","homepage":"https://github.com/syncthing/syncthing","size":61409,"stargazers_count":18,"watchers_count":18,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":0,"forks":5,"open_issues":0,"watchers":18,"default_branch":"master"}},"base":{"label":"syncthing:master","ref":"master","sha":"7351217489d708cccec2e52b6b061d1501e4aa8c","user":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","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://avatars.githubusercontent.com/u/7628018?v=3","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}","created_at":"2013-11-26T09:48:21Z","updated_at":"2015-10-20T19:10:20Z","pushed_at":"2015-10-20T20:57:16Z","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":"http://forum.syncthing.net/","size":76524,"stargazers_count":10102,"watchers_count":10102,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":732,"mirror_url":null,"open_issues_count":203,"forks":732,"open_issues":203,"watchers":10102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2397"},"html":{"href":"https://github.com/syncthing/syncthing/pull/2397"},"issue":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/2397"},"comments":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/2397/comments"},"review_comments":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2397/comments"},"review_comment":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2397/commits"},"statuses":{"href":"https://api.github.com/repos/syncthing/syncthing/statuses/a6db0be01e4894415fbbf6b0c8d6da0deb4bee22"}}}}