{"action":"created","comment":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments/33641640","id":33641640,"diff_hunk":"@@ -51,14 +52,32 @@ public RepoIO(boolean isTestMode, boolean enableTestJSON) {\n \n     public CompletableFuture<Model> openRepository(String repoId) {\n         if (repoStore.isRepoStored(repoId)) {\n-            return repoStore.loadRepository(repoId)\n-                .thenCompose(this::updateModel)\n-                .exceptionally(withResult(new Model(repoId)));\n+            return loadRepositoryFromStore(repoId);\n         } else {\n-            return repoSource.downloadRepository(repoId)\n+            return downloadRepositoryFromSource(repoId);\n+        }\n+    }\n+\n+    private CompletableFuture<Model> loadRepositoryFromStore(String repoId) {\n+        return repoStore.loadRepository(repoId)\n+                .thenCompose(this::updateModel)\n+                .exceptionally(ex -> {\n+                    try {","path":"src/main/java/backend/RepoIO.java","position":40,"original_position":40,"commit_id":"17d3d140ea8417c73089912470d6da42381c0876","original_commit_id":"5dea24e083569f28a73c4ae2c82b4ae71292a7ad","user":{"login":"ndt93","id":5065989,"avatar_url":"https://avatars.githubusercontent.com/u/5065989?v=3","gravatar_id":"","url":"https://api.github.com/users/ndt93","html_url":"https://github.com/ndt93","followers_url":"https://api.github.com/users/ndt93/followers","following_url":"https://api.github.com/users/ndt93/following{/other_user}","gists_url":"https://api.github.com/users/ndt93/gists{/gist_id}","starred_url":"https://api.github.com/users/ndt93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndt93/subscriptions","organizations_url":"https://api.github.com/users/ndt93/orgs","repos_url":"https://api.github.com/users/ndt93/repos","events_url":"https://api.github.com/users/ndt93/events{/privacy}","received_events_url":"https://api.github.com/users/ndt93/received_events","type":"User","site_admin":false},"body":"Ok well then I guess I would refactor the thing to `downloadRepoBlocking` later if no one else has other opinions on this.","created_at":"2015-07-01T01:32:56Z","updated_at":"2015-07-01T01:32:56Z","html_url":"https://github.com/HubTurbo/HubTurbo/pull/746#discussion_r33641640","pull_request_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746","_links":{"self":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments/33641640"},"html":{"href":"https://github.com/HubTurbo/HubTurbo/pull/746#discussion_r33641640"},"pull_request":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746"}}},"pull_request":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746","id":38710747,"html_url":"https://github.com/HubTurbo/HubTurbo/pull/746","diff_url":"https://github.com/HubTurbo/HubTurbo/pull/746.diff","patch_url":"https://github.com/HubTurbo/HubTurbo/pull/746.patch","issue_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/746","number":746,"state":"open","locked":false,"title":"No error notification or recovery on corrupted repo JSON #700","user":{"login":"ndt93","id":5065989,"avatar_url":"https://avatars.githubusercontent.com/u/5065989?v=3","gravatar_id":"","url":"https://api.github.com/users/ndt93","html_url":"https://github.com/ndt93","followers_url":"https://api.github.com/users/ndt93/followers","following_url":"https://api.github.com/users/ndt93/following{/other_user}","gists_url":"https://api.github.com/users/ndt93/gists{/gist_id}","starred_url":"https://api.github.com/users/ndt93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndt93/subscriptions","organizations_url":"https://api.github.com/users/ndt93/orgs","repos_url":"https://api.github.com/users/ndt93/repos","events_url":"https://api.github.com/users/ndt93/events{/privacy}","received_events_url":"https://api.github.com/users/ndt93/received_events","type":"User","site_admin":false},"body":"Fixes #700 \r\n\r\nThis only resolves the case in which the JSON data is arbitrarily corrupted. If the file is changed but still syntactically correct and fit into a Model object (likely from deliberate manipulation), the program won't be able to detect the mismatch.\r\n\r\nLol, the coveralls thing is so demanding :P","created_at":"2015-06-27T15:04:16Z","updated_at":"2015-07-01T01:32:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ec7ad16040bd48607be6f0821ea1dcc9ee0c08f","assignee":{"login":"acruis","id":8437638,"avatar_url":"https://avatars.githubusercontent.com/u/8437638?v=3","gravatar_id":"","url":"https://api.github.com/users/acruis","html_url":"https://github.com/acruis","followers_url":"https://api.github.com/users/acruis/followers","following_url":"https://api.github.com/users/acruis/following{/other_user}","gists_url":"https://api.github.com/users/acruis/gists{/gist_id}","starred_url":"https://api.github.com/users/acruis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acruis/subscriptions","organizations_url":"https://api.github.com/users/acruis/orgs","repos_url":"https://api.github.com/users/acruis/repos","events_url":"https://api.github.com/users/acruis/events{/privacy}","received_events_url":"https://api.github.com/users/acruis/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746/commits","review_comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746/comments","review_comment_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/746/comments","statuses_url":"https://api.github.com/repos/HubTurbo/HubTurbo/statuses/17d3d140ea8417c73089912470d6da42381c0876","head":{"label":"ndt93:Issue700","ref":"Issue700","sha":"17d3d140ea8417c73089912470d6da42381c0876","user":{"login":"ndt93","id":5065989,"avatar_url":"https://avatars.githubusercontent.com/u/5065989?v=3","gravatar_id":"","url":"https://api.github.com/users/ndt93","html_url":"https://github.com/ndt93","followers_url":"https://api.github.com/users/ndt93/followers","following_url":"https://api.github.com/users/ndt93/following{/other_user}","gists_url":"https://api.github.com/users/ndt93/gists{/gist_id}","starred_url":"https://api.github.com/users/ndt93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndt93/subscriptions","organizations_url":"https://api.github.com/users/ndt93/orgs","repos_url":"https://api.github.com/users/ndt93/repos","events_url":"https://api.github.com/users/ndt93/events{/privacy}","received_events_url":"https://api.github.com/users/ndt93/received_events","type":"User","site_admin":false},"repo":{"id":36964113,"name":"HubTurbo","full_name":"ndt93/HubTurbo","owner":{"login":"ndt93","id":5065989,"avatar_url":"https://avatars.githubusercontent.com/u/5065989?v=3","gravatar_id":"","url":"https://api.github.com/users/ndt93","html_url":"https://github.com/ndt93","followers_url":"https://api.github.com/users/ndt93/followers","following_url":"https://api.github.com/users/ndt93/following{/other_user}","gists_url":"https://api.github.com/users/ndt93/gists{/gist_id}","starred_url":"https://api.github.com/users/ndt93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndt93/subscriptions","organizations_url":"https://api.github.com/users/ndt93/orgs","repos_url":"https://api.github.com/users/ndt93/repos","events_url":"https://api.github.com/users/ndt93/events{/privacy}","received_events_url":"https://api.github.com/users/ndt93/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ndt93/HubTurbo","description":"A companion to GitHub for your desktop","fork":true,"url":"https://api.github.com/repos/ndt93/HubTurbo","forks_url":"https://api.github.com/repos/ndt93/HubTurbo/forks","keys_url":"https://api.github.com/repos/ndt93/HubTurbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ndt93/HubTurbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ndt93/HubTurbo/teams","hooks_url":"https://api.github.com/repos/ndt93/HubTurbo/hooks","issue_events_url":"https://api.github.com/repos/ndt93/HubTurbo/issues/events{/number}","events_url":"https://api.github.com/repos/ndt93/HubTurbo/events","assignees_url":"https://api.github.com/repos/ndt93/HubTurbo/assignees{/user}","branches_url":"https://api.github.com/repos/ndt93/HubTurbo/branches{/branch}","tags_url":"https://api.github.com/repos/ndt93/HubTurbo/tags","blobs_url":"https://api.github.com/repos/ndt93/HubTurbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ndt93/HubTurbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ndt93/HubTurbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ndt93/HubTurbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ndt93/HubTurbo/statuses/{sha}","languages_url":"https://api.github.com/repos/ndt93/HubTurbo/languages","stargazers_url":"https://api.github.com/repos/ndt93/HubTurbo/stargazers","contributors_url":"https://api.github.com/repos/ndt93/HubTurbo/contributors","subscribers_url":"https://api.github.com/repos/ndt93/HubTurbo/subscribers","subscription_url":"https://api.github.com/repos/ndt93/HubTurbo/subscription","commits_url":"https://api.github.com/repos/ndt93/HubTurbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ndt93/HubTurbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ndt93/HubTurbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ndt93/HubTurbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ndt93/HubTurbo/contents/{+path}","compare_url":"https://api.github.com/repos/ndt93/HubTurbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ndt93/HubTurbo/merges","archive_url":"https://api.github.com/repos/ndt93/HubTurbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ndt93/HubTurbo/downloads","issues_url":"https://api.github.com/repos/ndt93/HubTurbo/issues{/number}","pulls_url":"https://api.github.com/repos/ndt93/HubTurbo/pulls{/number}","milestones_url":"https://api.github.com/repos/ndt93/HubTurbo/milestones{/number}","notifications_url":"https://api.github.com/repos/ndt93/HubTurbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ndt93/HubTurbo/labels{/name}","releases_url":"https://api.github.com/repos/ndt93/HubTurbo/releases{/id}","created_at":"2015-06-06T02:14:06Z","updated_at":"2015-06-06T02:14:07Z","pushed_at":"2015-06-29T16:07:52Z","git_url":"git://github.com/ndt93/HubTurbo.git","ssh_url":"git@github.com:ndt93/HubTurbo.git","clone_url":"https://github.com/ndt93/HubTurbo.git","svn_url":"https://github.com/ndt93/HubTurbo","homepage":"http://hubturbo.info","size":65977,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"HubTurbo:master","ref":"master","sha":"6bb175cd59a9f5904d34ae2830b960199a99d31e","user":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"repo":{"id":20919534,"name":"HubTurbo","full_name":"HubTurbo/HubTurbo","owner":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HubTurbo/HubTurbo","description":"A companion to GitHub for your desktop","fork":false,"url":"https://api.github.com/repos/HubTurbo/HubTurbo","forks_url":"https://api.github.com/repos/HubTurbo/HubTurbo/forks","keys_url":"https://api.github.com/repos/HubTurbo/HubTurbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HubTurbo/HubTurbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HubTurbo/HubTurbo/teams","hooks_url":"https://api.github.com/repos/HubTurbo/HubTurbo/hooks","issue_events_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/events{/number}","events_url":"https://api.github.com/repos/HubTurbo/HubTurbo/events","assignees_url":"https://api.github.com/repos/HubTurbo/HubTurbo/assignees{/user}","branches_url":"https://api.github.com/repos/HubTurbo/HubTurbo/branches{/branch}","tags_url":"https://api.github.com/repos/HubTurbo/HubTurbo/tags","blobs_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HubTurbo/HubTurbo/statuses/{sha}","languages_url":"https://api.github.com/repos/HubTurbo/HubTurbo/languages","stargazers_url":"https://api.github.com/repos/HubTurbo/HubTurbo/stargazers","contributors_url":"https://api.github.com/repos/HubTurbo/HubTurbo/contributors","subscribers_url":"https://api.github.com/repos/HubTurbo/HubTurbo/subscribers","subscription_url":"https://api.github.com/repos/HubTurbo/HubTurbo/subscription","commits_url":"https://api.github.com/repos/HubTurbo/HubTurbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/HubTurbo/HubTurbo/contents/{+path}","compare_url":"https://api.github.com/repos/HubTurbo/HubTurbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HubTurbo/HubTurbo/merges","archive_url":"https://api.github.com/repos/HubTurbo/HubTurbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HubTurbo/HubTurbo/downloads","issues_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues{/number}","pulls_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls{/number}","milestones_url":"https://api.github.com/repos/HubTurbo/HubTurbo/milestones{/number}","notifications_url":"https://api.github.com/repos/HubTurbo/HubTurbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HubTurbo/HubTurbo/labels{/name}","releases_url":"https://api.github.com/repos/HubTurbo/HubTurbo/releases{/id}","created_at":"2014-06-17T10:35:39Z","updated_at":"2015-06-16T04:04:23Z","pushed_at":"2015-06-30T06:44:13Z","git_url":"git://github.com/HubTurbo/HubTurbo.git","ssh_url":"git@github.com:HubTurbo/HubTurbo.git","clone_url":"https://github.com/HubTurbo/HubTurbo.git","svn_url":"https://github.com/HubTurbo/HubTurbo","homepage":"http://hubturbo.info","size":71869,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":65,"forks":8,"open_issues":65,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746"},"html":{"href":"https://github.com/HubTurbo/HubTurbo/pull/746"},"issue":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/746"},"comments":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/746/comments"},"review_comments":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746/comments"},"review_comment":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/746/commits"},"statuses":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/statuses/17d3d140ea8417c73089912470d6da42381c0876"}}}}