{"action":"closed","number":666,"pull_request":{"url":"https://api.github.com/repos/atom/settings-view/pulls/666","id":46031592,"html_url":"https://github.com/atom/settings-view/pull/666","diff_url":"https://github.com/atom/settings-view/pull/666.diff","patch_url":"https://github.com/atom/settings-view/pull/666.patch","issue_url":"https://api.github.com/repos/atom/settings-view/issues/666","number":666,"state":"closed","locked":false,"title":"Show error in PackageDetailView when network is unavailable and package is not in cache","user":{"login":"izuzak","id":38924,"avatar_url":"https://avatars.githubusercontent.com/u/38924?v=3","gravatar_id":"","url":"https://api.github.com/users/izuzak","html_url":"https://github.com/izuzak","followers_url":"https://api.github.com/users/izuzak/followers","following_url":"https://api.github.com/users/izuzak/following{/other_user}","gists_url":"https://api.github.com/users/izuzak/gists{/gist_id}","starred_url":"https://api.github.com/users/izuzak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/izuzak/subscriptions","organizations_url":"https://api.github.com/users/izuzak/orgs","repos_url":"https://api.github.com/users/izuzak/repos","events_url":"https://api.github.com/users/izuzak/events{/privacy}","received_events_url":"https://api.github.com/users/izuzak/received_events","type":"User","site_admin":true},"body":"This fixes https://github.com/atom/settings-view/issues/634. It seems that `AtomIoClient.fetchFromCache` calls the callback with [a special combination of values](https://github.com/atom/settings-view/blob/86699fbf3e237b6d659ed28990964c943d05f49a/lib/atom-io-client.coffee#L110-L113) in case the network is unavailable and the package was not found in cache. This special value was handled elsewhere, but needed to be handled in PackageDetailView as well.\r\n\r\n 068ce24 adds a failing spec, which triggers this error:\r\n\r\n```\r\nPackageDetailView\r\n  it shows an error when package metadata cannot be loaded from the cache and the network is unavailable\r\n    TypeError: Cannot read property 'on' of undefined\r\n      at PackageCard.module.exports.PackageCard.handleButtonEvents (/Users/izuzak/github/settings-view/lib/package-card.coffee:157:17)\r\n      at PackageCard.module.exports.PackageCard.initialize (/Users/izuzak/github/settings-view/lib/package-card.coffee:69:6)\r\n      at PackageCard.View (/Users/izuzak/github/settings-view/node_modules/atom-space-pen-views/node_modules/space-pen/lib/space-pen.js:184:25)\r\n      at new PackageCard (/Users/izuzak/github/settings-view/lib/package-card.coffee:11:3)\r\n      at PackageDetailView.module.exports.PackageDetailView.completeInitialzation (/Users/izuzak/github/settings-view/lib/package-detail-view.coffee:63:26)\r\n      at /Users/izuzak/github/settings-view/lib/package-detail-view.coffee:98:10\r\n      at /Users/izuzak/github/settings-view/lib/atom-io-client.coffee:32:9\r\n      at AtomIoClient.<anonymous> (/Users/izuzak/github/settings-view/spec/package-detail-view-spec.coffee:69:7)\r\n      at AtomIoClient.module.exports.AtomIoClient.package (/Users/izuzak/github/settings-view/lib/atom-io-client.coffee:30:6)\r\n      at PackageDetailView.module.exports.PackageDetailView.fetchPackage (/Users/izuzak/github/settings-view/lib/package-detail-view.coffee:89:5)\r\n      at PackageDetailView.module.exports.PackageDetailView.loadPackage (/Users/izuzak/github/settings-view/lib/package-detail-view.coffee:83:10)\r\n      at PackageDetailView.module.exports.PackageDetailView.initialize (/Users/izuzak/github/settings-view/lib/package-detail-view.coffee:59:6)\r\n      at PackageDetailView.View (/Users/izuzak/github/settings-view/node_modules/atom-space-pen-views/node_modules/space-pen/lib/space-pen.js:184:25)\r\n      at new PackageDetailView (/Users/izuzak/github/settings-view/lib/package-detail-view.coffee:22:3)\r\n      at [object Object].<anonymous> (/Users/izuzak/github/settings-view/spec/package-detail-view-spec.coffee:71:16)\r\n```\r\n\r\nd8cc61f fixes the problem by checking the data returned by `AtomIoClient` and verifying that it has at least the package's `name` property before showing the package card.\r\n\r\ncc @kevinsawicki and @thedaniel for :eyes: ","created_at":"2015-09-25T16:32:57Z","updated_at":"2015-09-28T11:01:31Z","closed_at":"2015-09-28T11:01:31Z","merged_at":"2015-09-28T11:01:31Z","merge_commit_sha":"1e90a79ccd43a154ec2ff62d858958ac8fdb9c2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atom/settings-view/pulls/666/commits","review_comments_url":"https://api.github.com/repos/atom/settings-view/pulls/666/comments","review_comment_url":"https://api.github.com/repos/atom/settings-view/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atom/settings-view/issues/666/comments","statuses_url":"https://api.github.com/repos/atom/settings-view/statuses/22c429b55f8f4448e76f90234503dd15e73edd03","head":{"label":"atom:iz-fix-view-package-details-not-online-not-cached-not-installed","ref":"iz-fix-view-package-details-not-online-not-cached-not-installed","sha":"22c429b55f8f4448e76f90234503dd15e73edd03","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":12090329,"name":"settings-view","full_name":"atom/settings-view","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/settings-view","description":"Edit Atom settings","fork":false,"url":"https://api.github.com/repos/atom/settings-view","forks_url":"https://api.github.com/repos/atom/settings-view/forks","keys_url":"https://api.github.com/repos/atom/settings-view/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/settings-view/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/settings-view/teams","hooks_url":"https://api.github.com/repos/atom/settings-view/hooks","issue_events_url":"https://api.github.com/repos/atom/settings-view/issues/events{/number}","events_url":"https://api.github.com/repos/atom/settings-view/events","assignees_url":"https://api.github.com/repos/atom/settings-view/assignees{/user}","branches_url":"https://api.github.com/repos/atom/settings-view/branches{/branch}","tags_url":"https://api.github.com/repos/atom/settings-view/tags","blobs_url":"https://api.github.com/repos/atom/settings-view/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/settings-view/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/settings-view/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/settings-view/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/settings-view/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/settings-view/languages","stargazers_url":"https://api.github.com/repos/atom/settings-view/stargazers","contributors_url":"https://api.github.com/repos/atom/settings-view/contributors","subscribers_url":"https://api.github.com/repos/atom/settings-view/subscribers","subscription_url":"https://api.github.com/repos/atom/settings-view/subscription","commits_url":"https://api.github.com/repos/atom/settings-view/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/settings-view/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/settings-view/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/settings-view/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/settings-view/contents/{+path}","compare_url":"https://api.github.com/repos/atom/settings-view/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/settings-view/merges","archive_url":"https://api.github.com/repos/atom/settings-view/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/settings-view/downloads","issues_url":"https://api.github.com/repos/atom/settings-view/issues{/number}","pulls_url":"https://api.github.com/repos/atom/settings-view/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/settings-view/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/settings-view/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/settings-view/labels{/name}","releases_url":"https://api.github.com/repos/atom/settings-view/releases{/id}","created_at":"2013-08-13T19:16:23Z","updated_at":"2015-09-22T14:20:44Z","pushed_at":"2015-09-28T11:01:31Z","git_url":"git://github.com/atom/settings-view.git","ssh_url":"git@github.com:atom/settings-view.git","clone_url":"https://github.com/atom/settings-view.git","svn_url":"https://github.com/atom/settings-view","homepage":null,"size":4570,"stargazers_count":68,"watchers_count":68,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":123,"forks":70,"open_issues":123,"watchers":68,"default_branch":"master"}},"base":{"label":"atom:master","ref":"master","sha":"86699fbf3e237b6d659ed28990964c943d05f49a","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":12090329,"name":"settings-view","full_name":"atom/settings-view","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/settings-view","description":"Edit Atom settings","fork":false,"url":"https://api.github.com/repos/atom/settings-view","forks_url":"https://api.github.com/repos/atom/settings-view/forks","keys_url":"https://api.github.com/repos/atom/settings-view/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/settings-view/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/settings-view/teams","hooks_url":"https://api.github.com/repos/atom/settings-view/hooks","issue_events_url":"https://api.github.com/repos/atom/settings-view/issues/events{/number}","events_url":"https://api.github.com/repos/atom/settings-view/events","assignees_url":"https://api.github.com/repos/atom/settings-view/assignees{/user}","branches_url":"https://api.github.com/repos/atom/settings-view/branches{/branch}","tags_url":"https://api.github.com/repos/atom/settings-view/tags","blobs_url":"https://api.github.com/repos/atom/settings-view/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/settings-view/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/settings-view/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/settings-view/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/settings-view/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/settings-view/languages","stargazers_url":"https://api.github.com/repos/atom/settings-view/stargazers","contributors_url":"https://api.github.com/repos/atom/settings-view/contributors","subscribers_url":"https://api.github.com/repos/atom/settings-view/subscribers","subscription_url":"https://api.github.com/repos/atom/settings-view/subscription","commits_url":"https://api.github.com/repos/atom/settings-view/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/settings-view/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/settings-view/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/settings-view/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/settings-view/contents/{+path}","compare_url":"https://api.github.com/repos/atom/settings-view/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/settings-view/merges","archive_url":"https://api.github.com/repos/atom/settings-view/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/settings-view/downloads","issues_url":"https://api.github.com/repos/atom/settings-view/issues{/number}","pulls_url":"https://api.github.com/repos/atom/settings-view/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/settings-view/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/settings-view/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/settings-view/labels{/name}","releases_url":"https://api.github.com/repos/atom/settings-view/releases{/id}","created_at":"2013-08-13T19:16:23Z","updated_at":"2015-09-22T14:20:44Z","pushed_at":"2015-09-28T11:01:31Z","git_url":"git://github.com/atom/settings-view.git","ssh_url":"git@github.com:atom/settings-view.git","clone_url":"https://github.com/atom/settings-view.git","svn_url":"https://github.com/atom/settings-view","homepage":null,"size":4570,"stargazers_count":68,"watchers_count":68,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":123,"forks":70,"open_issues":123,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/settings-view/pulls/666"},"html":{"href":"https://github.com/atom/settings-view/pull/666"},"issue":{"href":"https://api.github.com/repos/atom/settings-view/issues/666"},"comments":{"href":"https://api.github.com/repos/atom/settings-view/issues/666/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/settings-view/pulls/666/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/settings-view/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atom/settings-view/pulls/666/commits"},"statuses":{"href":"https://api.github.com/repos/atom/settings-view/statuses/22c429b55f8f4448e76f90234503dd15e73edd03"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"izuzak","id":38924,"avatar_url":"https://avatars.githubusercontent.com/u/38924?v=3","gravatar_id":"","url":"https://api.github.com/users/izuzak","html_url":"https://github.com/izuzak","followers_url":"https://api.github.com/users/izuzak/followers","following_url":"https://api.github.com/users/izuzak/following{/other_user}","gists_url":"https://api.github.com/users/izuzak/gists{/gist_id}","starred_url":"https://api.github.com/users/izuzak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/izuzak/subscriptions","organizations_url":"https://api.github.com/users/izuzak/orgs","repos_url":"https://api.github.com/users/izuzak/repos","events_url":"https://api.github.com/users/izuzak/events{/privacy}","received_events_url":"https://api.github.com/users/izuzak/received_events","type":"User","site_admin":true},"comments":2,"review_comments":0,"commits":3,"additions":21,"deletions":3,"changed_files":2}}