{"action":"created","comment":{"url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/comments/52948011","id":52948011,"diff_hunk":"@@ -128,13 +128,11 @@ exports.getDeviceType = do ->\n \t\t\t\t\tthrow new Error('Device type not specified in config file')\n \t\t\t\treturn configFromFile.deviceType\n \n-# Calling this function updates the local device state, which is then used to synchronise\n-# the remote device state, repeating any failed updates until successfully synchronised.\n-# This function will also optimise updates by merging multiple updates and only sending the latest state.\n-exports.updateState = do ->\n+do ->\n \tapplyPromise = Promise.resolve()\n \ttargetState = {}\n \tactualState = {}\n+\tupdatePending = false","path":"src/device.coffee","position":12,"original_position":12,"commit_id":"c9dceafb40febd08f8c193c12e6590b20907c8c6","original_commit_id":"c9dceafb40febd08f8c193c12e6590b20907c8c6","user":{"login":"pcarranzav","id":2223590,"avatar_url":"https://avatars.githubusercontent.com/u/2223590?v=3","gravatar_id":"","url":"https://api.github.com/users/pcarranzav","html_url":"https://github.com/pcarranzav","followers_url":"https://api.github.com/users/pcarranzav/followers","following_url":"https://api.github.com/users/pcarranzav/following{/other_user}","gists_url":"https://api.github.com/users/pcarranzav/gists{/gist_id}","starred_url":"https://api.github.com/users/pcarranzav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcarranzav/subscriptions","organizations_url":"https://api.github.com/users/pcarranzav/orgs","repos_url":"https://api.github.com/users/pcarranzav/repos","events_url":"https://api.github.com/users/pcarranzav/events{/privacy}","received_events_url":"https://api.github.com/users/pcarranzav/received_events","type":"User","site_admin":false},"body":"Not exactly - that one is tri-state and refers to the application.update function itself (works as a sort of self-mutex). This one explicitly gives a true/false response to whether there's an update that should be applied but the supervisor can't apply it, specifically what users want when using this together with the update lock.\r\n\r\nMoreover, we can't require application.coffee here since we'd have circular requires.","created_at":"2016-02-15T22:05:32Z","updated_at":"2016-02-15T22:05:32Z","html_url":"https://github.com/resin-io/resin-supervisor/pull/97#discussion_r52948011","pull_request_url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/comments/52948011"},"html":{"href":"https://github.com/resin-io/resin-supervisor/pull/97#discussion_r52948011"},"pull_request":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97","id":59410944,"html_url":"https://github.com/resin-io/resin-supervisor/pull/97","diff_url":"https://github.com/resin-io/resin-supervisor/pull/97.diff","patch_url":"https://github.com/resin-io/resin-supervisor/pull/97.patch","issue_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/97","number":97,"state":"open","locked":false,"title":"Add endpoint to get device state","user":{"login":"pcarranzav","id":2223590,"avatar_url":"https://avatars.githubusercontent.com/u/2223590?v=3","gravatar_id":"","url":"https://api.github.com/users/pcarranzav","html_url":"https://github.com/pcarranzav","followers_url":"https://api.github.com/users/pcarranzav/followers","following_url":"https://api.github.com/users/pcarranzav/following{/other_user}","gists_url":"https://api.github.com/users/pcarranzav/gists{/gist_id}","starred_url":"https://api.github.com/users/pcarranzav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcarranzav/subscriptions","organizations_url":"https://api.github.com/users/pcarranzav/orgs","repos_url":"https://api.github.com/users/pcarranzav/repos","events_url":"https://api.github.com/users/pcarranzav/events{/privacy}","received_events_url":"https://api.github.com/users/pcarranzav/received_events","type":"User","site_admin":false},"body":"connects to #32\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/resin-io/resin-supervisor/97)\n<!-- Reviewable:end -->\n","created_at":"2016-02-15T20:37:11Z","updated_at":"2016-02-15T22:05:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10144f1b90eaec87dbbf7cbd1212e484c36c81ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97/commits","review_comments_url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97/comments","review_comment_url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/97/comments","statuses_url":"https://api.github.com/repos/resin-io/resin-supervisor/statuses/c9dceafb40febd08f8c193c12e6590b20907c8c6","head":{"label":"resin-io:32-endpoint-for-device-state","ref":"32-endpoint-for-device-state","sha":"c9dceafb40febd08f8c193c12e6590b20907c8c6","user":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":44161944,"name":"resin-supervisor","full_name":"resin-io/resin-supervisor","owner":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/resin-supervisor","description":"Resin Supervisor: resin.io's agent on devices.","fork":false,"url":"https://api.github.com/repos/resin-io/resin-supervisor","forks_url":"https://api.github.com/repos/resin-io/resin-supervisor/forks","keys_url":"https://api.github.com/repos/resin-io/resin-supervisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/resin-supervisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/resin-supervisor/teams","hooks_url":"https://api.github.com/repos/resin-io/resin-supervisor/hooks","issue_events_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/resin-supervisor/events","assignees_url":"https://api.github.com/repos/resin-io/resin-supervisor/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/resin-supervisor/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/resin-supervisor/tags","blobs_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/resin-supervisor/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/resin-supervisor/languages","stargazers_url":"https://api.github.com/repos/resin-io/resin-supervisor/stargazers","contributors_url":"https://api.github.com/repos/resin-io/resin-supervisor/contributors","subscribers_url":"https://api.github.com/repos/resin-io/resin-supervisor/subscribers","subscription_url":"https://api.github.com/repos/resin-io/resin-supervisor/subscription","commits_url":"https://api.github.com/repos/resin-io/resin-supervisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/resin-supervisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/resin-supervisor/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/resin-supervisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/resin-supervisor/merges","archive_url":"https://api.github.com/repos/resin-io/resin-supervisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/resin-supervisor/downloads","issues_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/resin-supervisor/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/resin-supervisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/resin-supervisor/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/resin-supervisor/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/resin-supervisor/deployments","created_at":"2015-10-13T08:15:58Z","updated_at":"2016-01-26T10:22:30Z","pushed_at":"2016-02-15T21:34:52Z","git_url":"git://github.com/resin-io/resin-supervisor.git","ssh_url":"git@github.com:resin-io/resin-supervisor.git","clone_url":"https://github.com/resin-io/resin-supervisor.git","svn_url":"https://github.com/resin-io/resin-supervisor","homepage":"https://resin.io","size":1457,"stargazers_count":16,"watchers_count":16,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":39,"forks":4,"open_issues":39,"watchers":16,"default_branch":"master"}},"base":{"label":"resin-io:master","ref":"master","sha":"9965bfeca115f6fe6c6df0dad726936977490e4a","user":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":44161944,"name":"resin-supervisor","full_name":"resin-io/resin-supervisor","owner":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/resin-supervisor","description":"Resin Supervisor: resin.io's agent on devices.","fork":false,"url":"https://api.github.com/repos/resin-io/resin-supervisor","forks_url":"https://api.github.com/repos/resin-io/resin-supervisor/forks","keys_url":"https://api.github.com/repos/resin-io/resin-supervisor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/resin-supervisor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/resin-supervisor/teams","hooks_url":"https://api.github.com/repos/resin-io/resin-supervisor/hooks","issue_events_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/resin-supervisor/events","assignees_url":"https://api.github.com/repos/resin-io/resin-supervisor/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/resin-supervisor/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/resin-supervisor/tags","blobs_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/resin-supervisor/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/resin-supervisor/languages","stargazers_url":"https://api.github.com/repos/resin-io/resin-supervisor/stargazers","contributors_url":"https://api.github.com/repos/resin-io/resin-supervisor/contributors","subscribers_url":"https://api.github.com/repos/resin-io/resin-supervisor/subscribers","subscription_url":"https://api.github.com/repos/resin-io/resin-supervisor/subscription","commits_url":"https://api.github.com/repos/resin-io/resin-supervisor/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/resin-supervisor/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/resin-supervisor/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/resin-supervisor/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/resin-supervisor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/resin-supervisor/merges","archive_url":"https://api.github.com/repos/resin-io/resin-supervisor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/resin-supervisor/downloads","issues_url":"https://api.github.com/repos/resin-io/resin-supervisor/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/resin-supervisor/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/resin-supervisor/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/resin-supervisor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/resin-supervisor/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/resin-supervisor/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/resin-supervisor/deployments","created_at":"2015-10-13T08:15:58Z","updated_at":"2016-01-26T10:22:30Z","pushed_at":"2016-02-15T21:34:52Z","git_url":"git://github.com/resin-io/resin-supervisor.git","ssh_url":"git@github.com:resin-io/resin-supervisor.git","clone_url":"https://github.com/resin-io/resin-supervisor.git","svn_url":"https://github.com/resin-io/resin-supervisor","homepage":"https://resin.io","size":1457,"stargazers_count":16,"watchers_count":16,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":39,"forks":4,"open_issues":39,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97"},"html":{"href":"https://github.com/resin-io/resin-supervisor/pull/97"},"issue":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/issues/97"},"comments":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/resin-io/resin-supervisor/statuses/c9dceafb40febd08f8c193c12e6590b20907c8c6"}}}}