{"action":"created","comment":{"url":"https://api.github.com/repos/sagemathinc/cocalc/pulls/comments/154436836","pull_request_review_id":80589158,"id":154436836,"diff_hunk":"@@ -932,26 +930,99 @@ class ProjectActions extends Actions\n                 path            : '.'\n                 cb              : (err, output) =>\n                     if not err\n-                        @setState(library_available: {\"#{k}\" : (output.exit_code == 0)})\n+                        library = @get_store().library\n+                        library = library.set(k, (output.exit_code == 0))\n+                        @setState(library: library)\n                     cb(err)\n-        setTimeout(async.eachOfSeries(LIBRARY, check), 1000)\n \n-    copy_from_library: (opts) =>\n-        opts = defaults opts,\n-            entry : 'first_steps'\n+        # reads the index file for the library (if it fails, we have no library)\n+        index = (cb) =>\n+            {webapp_client} = require('./webapp_client')\n+\n+            webapp_client.read_text_file_from_project\n+                project_id : @project_id\n+                path       : require('./library').examples_path + '/index.json'\n+                cb         : (err, response) =>\n+                    if err\n+                        cb(); return\n+                    try\n+                        data = misc.from_json(response.content)\n+                        library = @get_store().library.set('examples', data)","path":"src/smc-webapp/project_store.coffee","position":68,"original_position":68,"commit_id":"cd90133e9aa964b8b4c649fb509dcff384a86b2f","original_commit_id":"cd90133e9aa964b8b4c649fb509dcff384a86b2f","user":{"login":"johnjeng","id":618575,"avatar_url":"https://avatars1.githubusercontent.com/u/618575?v=4","gravatar_id":"","url":"https://api.github.com/users/johnjeng","html_url":"https://github.com/johnjeng","followers_url":"https://api.github.com/users/johnjeng/followers","following_url":"https://api.github.com/users/johnjeng/following{/other_user}","gists_url":"https://api.github.com/users/johnjeng/gists{/gist_id}","starred_url":"https://api.github.com/users/johnjeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnjeng/subscriptions","organizations_url":"https://api.github.com/users/johnjeng/orgs","repos_url":"https://api.github.com/users/johnjeng/repos","events_url":"https://api.github.com/users/johnjeng/events{/privacy}","received_events_url":"https://api.github.com/users/johnjeng/received_events","type":"User","site_admin":false},"body":"Per comment above, call `immutable.fromJS(data)` here so we don't have a mutability leak.","created_at":"2017-12-01T20:05:18Z","updated_at":"2017-12-01T20:10:21Z","html_url":"https://github.com/sagemathinc/cocalc/pull/2501#discussion_r154436836","pull_request_url":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sagemathinc/cocalc/pulls/comments/154436836"},"html":{"href":"https://github.com/sagemathinc/cocalc/pull/2501#discussion_r154436836"},"pull_request":{"href":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501"}}},"pull_request":{"url":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501","id":153103627,"html_url":"https://github.com/sagemathinc/cocalc/pull/2501","diff_url":"https://github.com/sagemathinc/cocalc/pull/2501.diff","patch_url":"https://github.com/sagemathinc/cocalc/pull/2501.patch","issue_url":"https://api.github.com/repos/sagemathinc/cocalc/issues/2501","number":2501,"state":"open","locked":false,"title":"Library2","user":{"login":"haraldschilly","id":207405,"avatar_url":"https://avatars0.githubusercontent.com/u/207405?v=4","gravatar_id":"","url":"https://api.github.com/users/haraldschilly","html_url":"https://github.com/haraldschilly","followers_url":"https://api.github.com/users/haraldschilly/followers","following_url":"https://api.github.com/users/haraldschilly/following{/other_user}","gists_url":"https://api.github.com/users/haraldschilly/gists{/gist_id}","starred_url":"https://api.github.com/users/haraldschilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haraldschilly/subscriptions","organizations_url":"https://api.github.com/users/haraldschilly/orgs","repos_url":"https://api.github.com/users/haraldschilly/repos","events_url":"https://api.github.com/users/haraldschilly/events{/privacy}","received_events_url":"https://api.github.com/users/haraldschilly/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-16T17:29:48Z","updated_at":"2017-12-01T20:10:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3fe638ecccc421b8988aab52ff7f601ef15139d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501/commits","review_comments_url":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501/comments","review_comment_url":"https://api.github.com/repos/sagemathinc/cocalc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sagemathinc/cocalc/issues/2501/comments","statuses_url":"https://api.github.com/repos/sagemathinc/cocalc/statuses/cd90133e9aa964b8b4c649fb509dcff384a86b2f","head":{"label":"sagemathinc:library2","ref":"library2","sha":"cd90133e9aa964b8b4c649fb509dcff384a86b2f","user":{"login":"sagemathinc","id":11307305,"avatar_url":"https://avatars0.githubusercontent.com/u/11307305?v=4","gravatar_id":"","url":"https://api.github.com/users/sagemathinc","html_url":"https://github.com/sagemathinc","followers_url":"https://api.github.com/users/sagemathinc/followers","following_url":"https://api.github.com/users/sagemathinc/following{/other_user}","gists_url":"https://api.github.com/users/sagemathinc/gists{/gist_id}","starred_url":"https://api.github.com/users/sagemathinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagemathinc/subscriptions","organizations_url":"https://api.github.com/users/sagemathinc/orgs","repos_url":"https://api.github.com/users/sagemathinc/repos","events_url":"https://api.github.com/users/sagemathinc/events{/privacy}","received_events_url":"https://api.github.com/users/sagemathinc/received_events","type":"Organization","site_admin":false},"repo":{"id":32500369,"name":"cocalc","full_name":"sagemathinc/cocalc","owner":{"login":"sagemathinc","id":11307305,"avatar_url":"https://avatars0.githubusercontent.com/u/11307305?v=4","gravatar_id":"","url":"https://api.github.com/users/sagemathinc","html_url":"https://github.com/sagemathinc","followers_url":"https://api.github.com/users/sagemathinc/followers","following_url":"https://api.github.com/users/sagemathinc/following{/other_user}","gists_url":"https://api.github.com/users/sagemathinc/gists{/gist_id}","starred_url":"https://api.github.com/users/sagemathinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagemathinc/subscriptions","organizations_url":"https://api.github.com/users/sagemathinc/orgs","repos_url":"https://api.github.com/users/sagemathinc/repos","events_url":"https://api.github.com/users/sagemathinc/events{/privacy}","received_events_url":"https://api.github.com/users/sagemathinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sagemathinc/cocalc","description":"CoCalc: Collaborative Calculation in the Cloud","fork":false,"url":"https://api.github.com/repos/sagemathinc/cocalc","forks_url":"https://api.github.com/repos/sagemathinc/cocalc/forks","keys_url":"https://api.github.com/repos/sagemathinc/cocalc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sagemathinc/cocalc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sagemathinc/cocalc/teams","hooks_url":"https://api.github.com/repos/sagemathinc/cocalc/hooks","issue_events_url":"https://api.github.com/repos/sagemathinc/cocalc/issues/events{/number}","events_url":"https://api.github.com/repos/sagemathinc/cocalc/events","assignees_url":"https://api.github.com/repos/sagemathinc/cocalc/assignees{/user}","branches_url":"https://api.github.com/repos/sagemathinc/cocalc/branches{/branch}","tags_url":"https://api.github.com/repos/sagemathinc/cocalc/tags","blobs_url":"https://api.github.com/repos/sagemathinc/cocalc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sagemathinc/cocalc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sagemathinc/cocalc/git/refs{/sha}","trees_url":"https://api.github.com/repos/sagemathinc/cocalc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sagemathinc/cocalc/statuses/{sha}","languages_url":"https://api.github.com/repos/sagemathinc/cocalc/languages","stargazers_url":"https://api.github.com/repos/sagemathinc/cocalc/stargazers","contributors_url":"https://api.github.com/repos/sagemathinc/cocalc/contributors","subscribers_url":"https://api.github.com/repos/sagemathinc/cocalc/subscribers","subscription_url":"https://api.github.com/repos/sagemathinc/cocalc/subscription","commits_url":"https://api.github.com/repos/sagemathinc/cocalc/commits{/sha}","git_commits_url":"https://api.github.com/repos/sagemathinc/cocalc/git/commits{/sha}","comments_url":"https://api.github.com/repos/sagemathinc/cocalc/comments{/number}","issue_comment_url":"https://api.github.com/repos/sagemathinc/cocalc/issues/comments{/number}","contents_url":"https://api.github.com/repos/sagemathinc/cocalc/contents/{+path}","compare_url":"https://api.github.com/repos/sagemathinc/cocalc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sagemathinc/cocalc/merges","archive_url":"https://api.github.com/repos/sagemathinc/cocalc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sagemathinc/cocalc/downloads","issues_url":"https://api.github.com/repos/sagemathinc/cocalc/issues{/number}","pulls_url":"https://api.github.com/repos/sagemathinc/cocalc/pulls{/number}","milestones_url":"https://api.github.com/repos/sagemathinc/cocalc/milestones{/number}","notifications_url":"https://api.github.com/repos/sagemathinc/cocalc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sagemathinc/cocalc/labels{/name}","releases_url":"https://api.github.com/repos/sagemathinc/cocalc/releases{/id}","deployments_url":"https://api.github.com/repos/sagemathinc/cocalc/deployments","created_at":"2015-03-19T04:16:53Z","updated_at":"2017-11-30T10:05:23Z","pushed_at":"2017-12-01T16:30:24Z","git_url":"git://github.com/sagemathinc/cocalc.git","ssh_url":"git@github.com:sagemathinc/cocalc.git","clone_url":"https://github.com/sagemathinc/cocalc.git","svn_url":"https://github.com/sagemathinc/cocalc","homepage":"https://CoCalc.com","size":183803,"stargazers_count":455,"watchers_count":455,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"archived":false,"open_issues_count":639,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":89,"open_issues":639,"watchers":455,"default_branch":"master"}},"base":{"label":"sagemathinc:master","ref":"master","sha":"d6962ad7c4236e58f9dfa98f724acb9c0dd8f621","user":{"login":"sagemathinc","id":11307305,"avatar_url":"https://avatars0.githubusercontent.com/u/11307305?v=4","gravatar_id":"","url":"https://api.github.com/users/sagemathinc","html_url":"https://github.com/sagemathinc","followers_url":"https://api.github.com/users/sagemathinc/followers","following_url":"https://api.github.com/users/sagemathinc/following{/other_user}","gists_url":"https://api.github.com/users/sagemathinc/gists{/gist_id}","starred_url":"https://api.github.com/users/sagemathinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagemathinc/subscriptions","organizations_url":"https://api.github.com/users/sagemathinc/orgs","repos_url":"https://api.github.com/users/sagemathinc/repos","events_url":"https://api.github.com/users/sagemathinc/events{/privacy}","received_events_url":"https://api.github.com/users/sagemathinc/received_events","type":"Organization","site_admin":false},"repo":{"id":32500369,"name":"cocalc","full_name":"sagemathinc/cocalc","owner":{"login":"sagemathinc","id":11307305,"avatar_url":"https://avatars0.githubusercontent.com/u/11307305?v=4","gravatar_id":"","url":"https://api.github.com/users/sagemathinc","html_url":"https://github.com/sagemathinc","followers_url":"https://api.github.com/users/sagemathinc/followers","following_url":"https://api.github.com/users/sagemathinc/following{/other_user}","gists_url":"https://api.github.com/users/sagemathinc/gists{/gist_id}","starred_url":"https://api.github.com/users/sagemathinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sagemathinc/subscriptions","organizations_url":"https://api.github.com/users/sagemathinc/orgs","repos_url":"https://api.github.com/users/sagemathinc/repos","events_url":"https://api.github.com/users/sagemathinc/events{/privacy}","received_events_url":"https://api.github.com/users/sagemathinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sagemathinc/cocalc","description":"CoCalc: Collaborative Calculation in the Cloud","fork":false,"url":"https://api.github.com/repos/sagemathinc/cocalc","forks_url":"https://api.github.com/repos/sagemathinc/cocalc/forks","keys_url":"https://api.github.com/repos/sagemathinc/cocalc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sagemathinc/cocalc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sagemathinc/cocalc/teams","hooks_url":"https://api.github.com/repos/sagemathinc/cocalc/hooks","issue_events_url":"https://api.github.com/repos/sagemathinc/cocalc/issues/events{/number}","events_url":"https://api.github.com/repos/sagemathinc/cocalc/events","assignees_url":"https://api.github.com/repos/sagemathinc/cocalc/assignees{/user}","branches_url":"https://api.github.com/repos/sagemathinc/cocalc/branches{/branch}","tags_url":"https://api.github.com/repos/sagemathinc/cocalc/tags","blobs_url":"https://api.github.com/repos/sagemathinc/cocalc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sagemathinc/cocalc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sagemathinc/cocalc/git/refs{/sha}","trees_url":"https://api.github.com/repos/sagemathinc/cocalc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sagemathinc/cocalc/statuses/{sha}","languages_url":"https://api.github.com/repos/sagemathinc/cocalc/languages","stargazers_url":"https://api.github.com/repos/sagemathinc/cocalc/stargazers","contributors_url":"https://api.github.com/repos/sagemathinc/cocalc/contributors","subscribers_url":"https://api.github.com/repos/sagemathinc/cocalc/subscribers","subscription_url":"https://api.github.com/repos/sagemathinc/cocalc/subscription","commits_url":"https://api.github.com/repos/sagemathinc/cocalc/commits{/sha}","git_commits_url":"https://api.github.com/repos/sagemathinc/cocalc/git/commits{/sha}","comments_url":"https://api.github.com/repos/sagemathinc/cocalc/comments{/number}","issue_comment_url":"https://api.github.com/repos/sagemathinc/cocalc/issues/comments{/number}","contents_url":"https://api.github.com/repos/sagemathinc/cocalc/contents/{+path}","compare_url":"https://api.github.com/repos/sagemathinc/cocalc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sagemathinc/cocalc/merges","archive_url":"https://api.github.com/repos/sagemathinc/cocalc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sagemathinc/cocalc/downloads","issues_url":"https://api.github.com/repos/sagemathinc/cocalc/issues{/number}","pulls_url":"https://api.github.com/repos/sagemathinc/cocalc/pulls{/number}","milestones_url":"https://api.github.com/repos/sagemathinc/cocalc/milestones{/number}","notifications_url":"https://api.github.com/repos/sagemathinc/cocalc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sagemathinc/cocalc/labels{/name}","releases_url":"https://api.github.com/repos/sagemathinc/cocalc/releases{/id}","deployments_url":"https://api.github.com/repos/sagemathinc/cocalc/deployments","created_at":"2015-03-19T04:16:53Z","updated_at":"2017-11-30T10:05:23Z","pushed_at":"2017-12-01T16:30:24Z","git_url":"git://github.com/sagemathinc/cocalc.git","ssh_url":"git@github.com:sagemathinc/cocalc.git","clone_url":"https://github.com/sagemathinc/cocalc.git","svn_url":"https://github.com/sagemathinc/cocalc","homepage":"https://CoCalc.com","size":183803,"stargazers_count":455,"watchers_count":455,"language":"CoffeeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":89,"mirror_url":null,"archived":false,"open_issues_count":639,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":89,"open_issues":639,"watchers":455,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501"},"html":{"href":"https://github.com/sagemathinc/cocalc/pull/2501"},"issue":{"href":"https://api.github.com/repos/sagemathinc/cocalc/issues/2501"},"comments":{"href":"https://api.github.com/repos/sagemathinc/cocalc/issues/2501/comments"},"review_comments":{"href":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501/comments"},"review_comment":{"href":"https://api.github.com/repos/sagemathinc/cocalc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sagemathinc/cocalc/pulls/2501/commits"},"statuses":{"href":"https://api.github.com/repos/sagemathinc/cocalc/statuses/cd90133e9aa964b8b4c649fb509dcff384a86b2f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"johnjeng"}}