{"action":"created","comment":{"url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/comments/68586218","id":68586218,"diff_hunk":"@@ -158,17 +187,46 @@ class NotificationHandle {\n }\n \n class PersistentUiViewImpl {\n-  constructor(persistentMethods) {\n+  constructor(persistentMethods, grain) {\n+    this._grain = grain;\n     _.extend(this, persistentMethods);\n   }\n \n+  getViewInfo() {\n+    const viewInfo = this._grain.cachedViewInfo;\n+    return inMeteor(() => {\n+      const pkg = Packages.findOne({ _id: this._grain.packageId });\n+      const manifest = pkg.manifest || {};\n+      if (!viewInfo.metadata) {\n+        viewInfo.metadata = {};\n+      }\n+\n+      if (!viewInfo.metadata.appTitle) {\n+        viewInfo.metadata.appTitle = manifest.appTitle || {};\n+      }\n+\n+      if (!viewInfo.metadata.icon && !viewInfo.metadata.appId) {\n+        const grainIcon = ((manifest.metadata || {}).icons || {}).grain;\n+        if (grainIcon) {\n+          viewInfo.metadata.icon = grainIcon;\n+        } else {\n+          viewInfo.metadata.appId = pkg.appId;\n+        }\n+      }\n+\n+      return viewInfo;\n+    });\n+  }\n+\n   // All other UiView methods are currently unimplemented, which, while not strictly correct,\n   // results in the same overall behavior, since users can't call restore() on a PersistentUiView,\n   // and grains can't call methods on UiViews because they lack the \"is human\" pseudopermission.\n }\n \n-const makePersistentUiView = function (persistentMethods) {\n-  return new Capnp.Capability(new PersistentUiViewImpl(persistentMethods), PersistentUiView);\n+const makePersistentUiView = function (persistentMethods, grainId) {\n+  check(grainId, String);\n+  const grain = Grains.findOne({ _id: grainId });","path":"shell/server/core.js","position":124,"original_position":124,"commit_id":"4d3ace0174e4230a89743e5368f9ead92eaedf8c","original_commit_id":"4d3ace0174e4230a89743e5368f9ead92eaedf8c","user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"body":"Good point. I think makes sense to also do the query here so we can throw an error early if the grain has been deleted.","created_at":"2016-06-27T14:30:35Z","updated_at":"2016-06-27T14:30:35Z","html_url":"https://github.com/sandstorm-io/sandstorm/pull/2027#discussion_r68586218","pull_request_url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027","_links":{"self":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/comments/68586218"},"html":{"href":"https://github.com/sandstorm-io/sandstorm/pull/2027#discussion_r68586218"},"pull_request":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027"}}},"pull_request":{"url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027","id":72442870,"html_url":"https://github.com/sandstorm-io/sandstorm/pull/2027","diff_url":"https://github.com/sandstorm-io/sandstorm/pull/2027.diff","patch_url":"https://github.com/sandstorm-io/sandstorm/pull/2027.patch","issue_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/2027","number":2027,"state":"open","locked":false,"title":"claimRequest() and other powerbox-related updates","user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"body":"This pulls together the work from #2016 and #2019.\r\n\r\nThe ip-networking integration tests are working after applying https://github.com/zarvox/sandstorm-test-python/pull/4.\r\n\r\nI have not yet updated the other powerbox integration tests, which are based on https://github.com/jparyani/sandstorm-test-app. So this will not pass Jenkins.\r\n\r\nI've split out a new file powerbox.capnp. Doing so isn't strictly necessary for this change, but if we want to do that eventually, now seems like an opportune time.\r\n\r\nI've not yet addressed all of the comments in #2019, but I wanted to get this pull request up for discussion.\r\n\r\n","created_at":"2016-06-03T01:39:09Z","updated_at":"2016-06-27T14:30:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d86988e34e12587bb50af2557ed7bff0bec4950","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027/commits","review_comments_url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027/comments","review_comment_url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/2027/comments","statuses_url":"https://api.github.com/repos/sandstorm-io/sandstorm/statuses/4d3ace0174e4230a89743e5368f9ead92eaedf8c","head":{"label":"dwrensha:powerbox","ref":"powerbox","sha":"4d3ace0174e4230a89743e5368f9ead92eaedf8c","user":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"repo":{"id":17964729,"name":"sandstorm","full_name":"dwrensha/sandstorm","owner":{"login":"dwrensha","id":495768,"avatar_url":"https://avatars.githubusercontent.com/u/495768?v=3","gravatar_id":"","url":"https://api.github.com/users/dwrensha","html_url":"https://github.com/dwrensha","followers_url":"https://api.github.com/users/dwrensha/followers","following_url":"https://api.github.com/users/dwrensha/following{/other_user}","gists_url":"https://api.github.com/users/dwrensha/gists{/gist_id}","starred_url":"https://api.github.com/users/dwrensha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwrensha/subscriptions","organizations_url":"https://api.github.com/users/dwrensha/orgs","repos_url":"https://api.github.com/users/dwrensha/repos","events_url":"https://api.github.com/users/dwrensha/events{/privacy}","received_events_url":"https://api.github.com/users/dwrensha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dwrensha/sandstorm","description":"Personal Cloud Sandbox","fork":true,"url":"https://api.github.com/repos/dwrensha/sandstorm","forks_url":"https://api.github.com/repos/dwrensha/sandstorm/forks","keys_url":"https://api.github.com/repos/dwrensha/sandstorm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dwrensha/sandstorm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dwrensha/sandstorm/teams","hooks_url":"https://api.github.com/repos/dwrensha/sandstorm/hooks","issue_events_url":"https://api.github.com/repos/dwrensha/sandstorm/issues/events{/number}","events_url":"https://api.github.com/repos/dwrensha/sandstorm/events","assignees_url":"https://api.github.com/repos/dwrensha/sandstorm/assignees{/user}","branches_url":"https://api.github.com/repos/dwrensha/sandstorm/branches{/branch}","tags_url":"https://api.github.com/repos/dwrensha/sandstorm/tags","blobs_url":"https://api.github.com/repos/dwrensha/sandstorm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dwrensha/sandstorm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dwrensha/sandstorm/git/refs{/sha}","trees_url":"https://api.github.com/repos/dwrensha/sandstorm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dwrensha/sandstorm/statuses/{sha}","languages_url":"https://api.github.com/repos/dwrensha/sandstorm/languages","stargazers_url":"https://api.github.com/repos/dwrensha/sandstorm/stargazers","contributors_url":"https://api.github.com/repos/dwrensha/sandstorm/contributors","subscribers_url":"https://api.github.com/repos/dwrensha/sandstorm/subscribers","subscription_url":"https://api.github.com/repos/dwrensha/sandstorm/subscription","commits_url":"https://api.github.com/repos/dwrensha/sandstorm/commits{/sha}","git_commits_url":"https://api.github.com/repos/dwrensha/sandstorm/git/commits{/sha}","comments_url":"https://api.github.com/repos/dwrensha/sandstorm/comments{/number}","issue_comment_url":"https://api.github.com/repos/dwrensha/sandstorm/issues/comments{/number}","contents_url":"https://api.github.com/repos/dwrensha/sandstorm/contents/{+path}","compare_url":"https://api.github.com/repos/dwrensha/sandstorm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dwrensha/sandstorm/merges","archive_url":"https://api.github.com/repos/dwrensha/sandstorm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dwrensha/sandstorm/downloads","issues_url":"https://api.github.com/repos/dwrensha/sandstorm/issues{/number}","pulls_url":"https://api.github.com/repos/dwrensha/sandstorm/pulls{/number}","milestones_url":"https://api.github.com/repos/dwrensha/sandstorm/milestones{/number}","notifications_url":"https://api.github.com/repos/dwrensha/sandstorm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dwrensha/sandstorm/labels{/name}","releases_url":"https://api.github.com/repos/dwrensha/sandstorm/releases{/id}","deployments_url":"https://api.github.com/repos/dwrensha/sandstorm/deployments","created_at":"2014-03-21T01:42:05Z","updated_at":"2016-01-11T12:49:39Z","pushed_at":"2016-06-27T01:53:22Z","git_url":"git://github.com/dwrensha/sandstorm.git","ssh_url":"git@github.com:dwrensha/sandstorm.git","clone_url":"https://github.com/dwrensha/sandstorm.git","svn_url":"https://github.com/dwrensha/sandstorm","homepage":null,"size":13687,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sandstorm-io:master","ref":"master","sha":"e455ada05efd7afa3a0c5ae6dbf75cb65202d8cb","user":{"login":"sandstorm-io","id":7479094,"avatar_url":"https://avatars.githubusercontent.com/u/7479094?v=3","gravatar_id":"","url":"https://api.github.com/users/sandstorm-io","html_url":"https://github.com/sandstorm-io","followers_url":"https://api.github.com/users/sandstorm-io/followers","following_url":"https://api.github.com/users/sandstorm-io/following{/other_user}","gists_url":"https://api.github.com/users/sandstorm-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sandstorm-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandstorm-io/subscriptions","organizations_url":"https://api.github.com/users/sandstorm-io/orgs","repos_url":"https://api.github.com/users/sandstorm-io/repos","events_url":"https://api.github.com/users/sandstorm-io/events{/privacy}","received_events_url":"https://api.github.com/users/sandstorm-io/received_events","type":"Organization","site_admin":false},"repo":{"id":15728293,"name":"sandstorm","full_name":"sandstorm-io/sandstorm","owner":{"login":"sandstorm-io","id":7479094,"avatar_url":"https://avatars.githubusercontent.com/u/7479094?v=3","gravatar_id":"","url":"https://api.github.com/users/sandstorm-io","html_url":"https://github.com/sandstorm-io","followers_url":"https://api.github.com/users/sandstorm-io/followers","following_url":"https://api.github.com/users/sandstorm-io/following{/other_user}","gists_url":"https://api.github.com/users/sandstorm-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sandstorm-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandstorm-io/subscriptions","organizations_url":"https://api.github.com/users/sandstorm-io/orgs","repos_url":"https://api.github.com/users/sandstorm-io/repos","events_url":"https://api.github.com/users/sandstorm-io/events{/privacy}","received_events_url":"https://api.github.com/users/sandstorm-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sandstorm-io/sandstorm","description":"Personal Cloud Sandbox","fork":false,"url":"https://api.github.com/repos/sandstorm-io/sandstorm","forks_url":"https://api.github.com/repos/sandstorm-io/sandstorm/forks","keys_url":"https://api.github.com/repos/sandstorm-io/sandstorm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sandstorm-io/sandstorm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sandstorm-io/sandstorm/teams","hooks_url":"https://api.github.com/repos/sandstorm-io/sandstorm/hooks","issue_events_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/events{/number}","events_url":"https://api.github.com/repos/sandstorm-io/sandstorm/events","assignees_url":"https://api.github.com/repos/sandstorm-io/sandstorm/assignees{/user}","branches_url":"https://api.github.com/repos/sandstorm-io/sandstorm/branches{/branch}","tags_url":"https://api.github.com/repos/sandstorm-io/sandstorm/tags","blobs_url":"https://api.github.com/repos/sandstorm-io/sandstorm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sandstorm-io/sandstorm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sandstorm-io/sandstorm/git/refs{/sha}","trees_url":"https://api.github.com/repos/sandstorm-io/sandstorm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sandstorm-io/sandstorm/statuses/{sha}","languages_url":"https://api.github.com/repos/sandstorm-io/sandstorm/languages","stargazers_url":"https://api.github.com/repos/sandstorm-io/sandstorm/stargazers","contributors_url":"https://api.github.com/repos/sandstorm-io/sandstorm/contributors","subscribers_url":"https://api.github.com/repos/sandstorm-io/sandstorm/subscribers","subscription_url":"https://api.github.com/repos/sandstorm-io/sandstorm/subscription","commits_url":"https://api.github.com/repos/sandstorm-io/sandstorm/commits{/sha}","git_commits_url":"https://api.github.com/repos/sandstorm-io/sandstorm/git/commits{/sha}","comments_url":"https://api.github.com/repos/sandstorm-io/sandstorm/comments{/number}","issue_comment_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/comments{/number}","contents_url":"https://api.github.com/repos/sandstorm-io/sandstorm/contents/{+path}","compare_url":"https://api.github.com/repos/sandstorm-io/sandstorm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sandstorm-io/sandstorm/merges","archive_url":"https://api.github.com/repos/sandstorm-io/sandstorm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sandstorm-io/sandstorm/downloads","issues_url":"https://api.github.com/repos/sandstorm-io/sandstorm/issues{/number}","pulls_url":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls{/number}","milestones_url":"https://api.github.com/repos/sandstorm-io/sandstorm/milestones{/number}","notifications_url":"https://api.github.com/repos/sandstorm-io/sandstorm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sandstorm-io/sandstorm/labels{/name}","releases_url":"https://api.github.com/repos/sandstorm-io/sandstorm/releases{/id}","deployments_url":"https://api.github.com/repos/sandstorm-io/sandstorm/deployments","created_at":"2014-01-08T07:10:33Z","updated_at":"2016-06-26T10:34:54Z","pushed_at":"2016-06-27T01:00:16Z","git_url":"git://github.com/sandstorm-io/sandstorm.git","ssh_url":"git@github.com:sandstorm-io/sandstorm.git","clone_url":"https://github.com/sandstorm-io/sandstorm.git","svn_url":"https://github.com/sandstorm-io/sandstorm","homepage":"https://sandstorm.io","size":37489,"stargazers_count":3600,"watchers_count":3600,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":321,"mirror_url":null,"open_issues_count":430,"forks":321,"open_issues":430,"watchers":3600,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027"},"html":{"href":"https://github.com/sandstorm-io/sandstorm/pull/2027"},"issue":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/2027"},"comments":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/issues/2027/comments"},"review_comments":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027/comments"},"review_comment":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/pulls/2027/commits"},"statuses":{"href":"https://api.github.com/repos/sandstorm-io/sandstorm/statuses/4d3ace0174e4230a89743e5368f9ead92eaedf8c"}}}}
{"actor":{"display_login":"dwrensha"}}