{"action":"created","comment":{"url":"https://api.github.com/repos/vingtetun/sw_fm/pulls/comments/34466775","id":34466775,"diff_hunk":"@@ -215,47 +310,90 @@\n         // But for now we are lazy and start the server as soon the client\n         // is connected.\n \n-        if (!hasServerForContract(contract)) {\n-          var config = getConfigForContract(contract)\n-          var server = new kConfigTypes[config.type](config.url);\n+        if (hasServerReadyForContract(contract)) {\n+          var server = getServerForContract(contract);\n+          registerClientToServer(contract, server, registration.uuid);\n+        } else {\n+          startServer(contract);\n+        }","path":"app/bridge/smuggler.js","position":203,"original_position":203,"commit_id":"7a4d9f40d2ba3d8cb4e2cb842c76ee843f5f97ff","original_commit_id":"7a4d9f40d2ba3d8cb4e2cb842c76ee843f5f97ff","user":{"login":"vingtetun","id":579794,"avatar_url":"https://avatars.githubusercontent.com/u/579794?v=3","gravatar_id":"","url":"https://api.github.com/users/vingtetun","html_url":"https://github.com/vingtetun","followers_url":"https://api.github.com/users/vingtetun/followers","following_url":"https://api.github.com/users/vingtetun/following{/other_user}","gists_url":"https://api.github.com/users/vingtetun/gists{/gist_id}","starred_url":"https://api.github.com/users/vingtetun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vingtetun/subscriptions","organizations_url":"https://api.github.com/users/vingtetun/orgs","repos_url":"https://api.github.com/users/vingtetun/repos","events_url":"https://api.github.com/users/vingtetun/events{/privacy}","received_events_url":"https://api.github.com/users/vingtetun/received_events","type":"User","site_admin":false},"body":"Just curious, why does the server needs to be ready ?","created_at":"2015-07-13T14:17:17Z","updated_at":"2015-07-13T14:17:17Z","html_url":"https://github.com/vingtetun/sw_fm/pull/2#discussion_r34466775","pull_request_url":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/vingtetun/sw_fm/pulls/comments/34466775"},"html":{"href":"https://github.com/vingtetun/sw_fm/pull/2#discussion_r34466775"},"pull_request":{"href":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2","id":38526738,"html_url":"https://github.com/vingtetun/sw_fm/pull/2","diff_url":"https://github.com/vingtetun/sw_fm/pull/2.diff","patch_url":"https://github.com/vingtetun/sw_fm/pull/2.patch","issue_url":"https://api.github.com/repos/vingtetun/sw_fm/issues/2","number":2,"state":"open","locked":false,"title":"unloading/reloading of the 'logic' server","user":{"login":"autra","id":1576598,"avatar_url":"https://avatars.githubusercontent.com/u/1576598?v=3","gravatar_id":"","url":"https://api.github.com/users/autra","html_url":"https://github.com/autra","followers_url":"https://api.github.com/users/autra/followers","following_url":"https://api.github.com/users/autra/following{/other_user}","gists_url":"https://api.github.com/users/autra/gists{/gist_id}","starred_url":"https://api.github.com/users/autra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autra/subscriptions","organizations_url":"https://api.github.com/users/autra/orgs","repos_url":"https://api.github.com/users/autra/repos","events_url":"https://api.github.com/users/autra/events{/privacy}","received_events_url":"https://api.github.com/users/autra/received_events","type":"User","site_admin":false},"body":"Hi @vingtetun !\r\n\r\nSo here is what you were desperately waiting for (you were, right? ;-) )\r\n\r\nSorry, it's a bit messy right now, but functionally, it should kill the iframe and restore it when you put fm in background/back in foreground. Anyway, I guess we will have to rewrite everything with Thread.js... We had a lot of corners cases to fix and deal with. \r\n\r\nI've started to experiment on memory gain, and the results are here: https://github.com/Phoxygen/sw_fm/issues/4 . (Somewhat disappointing).\r\n\r\nThanks for your review!","created_at":"2015-06-25T09:15:38Z","updated_at":"2015-07-13T14:17:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f60c8dcdd0edff598d7ee6b362d071484f974996","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2/commits","review_comments_url":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2/comments","review_comment_url":"https://api.github.com/repos/vingtetun/sw_fm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vingtetun/sw_fm/issues/2/comments","statuses_url":"https://api.github.com/repos/vingtetun/sw_fm/statuses/7a4d9f40d2ba3d8cb4e2cb842c76ee843f5f97ff","head":{"label":"Phoxygen:experimentation","ref":"experimentation","sha":"7a4d9f40d2ba3d8cb4e2cb842c76ee843f5f97ff","user":{"login":"Phoxygen","id":10355929,"avatar_url":"https://avatars.githubusercontent.com/u/10355929?v=3","gravatar_id":"","url":"https://api.github.com/users/Phoxygen","html_url":"https://github.com/Phoxygen","followers_url":"https://api.github.com/users/Phoxygen/followers","following_url":"https://api.github.com/users/Phoxygen/following{/other_user}","gists_url":"https://api.github.com/users/Phoxygen/gists{/gist_id}","starred_url":"https://api.github.com/users/Phoxygen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phoxygen/subscriptions","organizations_url":"https://api.github.com/users/Phoxygen/orgs","repos_url":"https://api.github.com/users/Phoxygen/repos","events_url":"https://api.github.com/users/Phoxygen/events{/privacy}","received_events_url":"https://api.github.com/users/Phoxygen/received_events","type":"Organization","site_admin":false},"repo":{"id":35026249,"name":"sw_fm","full_name":"Phoxygen/sw_fm","owner":{"login":"Phoxygen","id":10355929,"avatar_url":"https://avatars.githubusercontent.com/u/10355929?v=3","gravatar_id":"","url":"https://api.github.com/users/Phoxygen","html_url":"https://github.com/Phoxygen","followers_url":"https://api.github.com/users/Phoxygen/followers","following_url":"https://api.github.com/users/Phoxygen/following{/other_user}","gists_url":"https://api.github.com/users/Phoxygen/gists{/gist_id}","starred_url":"https://api.github.com/users/Phoxygen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phoxygen/subscriptions","organizations_url":"https://api.github.com/users/Phoxygen/orgs","repos_url":"https://api.github.com/users/Phoxygen/repos","events_url":"https://api.github.com/users/Phoxygen/events{/privacy}","received_events_url":"https://api.github.com/users/Phoxygen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Phoxygen/sw_fm","description":"","fork":true,"url":"https://api.github.com/repos/Phoxygen/sw_fm","forks_url":"https://api.github.com/repos/Phoxygen/sw_fm/forks","keys_url":"https://api.github.com/repos/Phoxygen/sw_fm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Phoxygen/sw_fm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Phoxygen/sw_fm/teams","hooks_url":"https://api.github.com/repos/Phoxygen/sw_fm/hooks","issue_events_url":"https://api.github.com/repos/Phoxygen/sw_fm/issues/events{/number}","events_url":"https://api.github.com/repos/Phoxygen/sw_fm/events","assignees_url":"https://api.github.com/repos/Phoxygen/sw_fm/assignees{/user}","branches_url":"https://api.github.com/repos/Phoxygen/sw_fm/branches{/branch}","tags_url":"https://api.github.com/repos/Phoxygen/sw_fm/tags","blobs_url":"https://api.github.com/repos/Phoxygen/sw_fm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Phoxygen/sw_fm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Phoxygen/sw_fm/git/refs{/sha}","trees_url":"https://api.github.com/repos/Phoxygen/sw_fm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Phoxygen/sw_fm/statuses/{sha}","languages_url":"https://api.github.com/repos/Phoxygen/sw_fm/languages","stargazers_url":"https://api.github.com/repos/Phoxygen/sw_fm/stargazers","contributors_url":"https://api.github.com/repos/Phoxygen/sw_fm/contributors","subscribers_url":"https://api.github.com/repos/Phoxygen/sw_fm/subscribers","subscription_url":"https://api.github.com/repos/Phoxygen/sw_fm/subscription","commits_url":"https://api.github.com/repos/Phoxygen/sw_fm/commits{/sha}","git_commits_url":"https://api.github.com/repos/Phoxygen/sw_fm/git/commits{/sha}","comments_url":"https://api.github.com/repos/Phoxygen/sw_fm/comments{/number}","issue_comment_url":"https://api.github.com/repos/Phoxygen/sw_fm/issues/comments{/number}","contents_url":"https://api.github.com/repos/Phoxygen/sw_fm/contents/{+path}","compare_url":"https://api.github.com/repos/Phoxygen/sw_fm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Phoxygen/sw_fm/merges","archive_url":"https://api.github.com/repos/Phoxygen/sw_fm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Phoxygen/sw_fm/downloads","issues_url":"https://api.github.com/repos/Phoxygen/sw_fm/issues{/number}","pulls_url":"https://api.github.com/repos/Phoxygen/sw_fm/pulls{/number}","milestones_url":"https://api.github.com/repos/Phoxygen/sw_fm/milestones{/number}","notifications_url":"https://api.github.com/repos/Phoxygen/sw_fm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Phoxygen/sw_fm/labels{/name}","releases_url":"https://api.github.com/repos/Phoxygen/sw_fm/releases{/id}","created_at":"2015-05-04T09:32:10Z","updated_at":"2015-05-11T10:07:42Z","pushed_at":"2015-07-10T14:51:40Z","git_url":"git://github.com/Phoxygen/sw_fm.git","ssh_url":"git@github.com:Phoxygen/sw_fm.git","clone_url":"https://github.com/Phoxygen/sw_fm.git","svn_url":"https://github.com/Phoxygen/sw_fm","homepage":null,"size":449,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"vingtetun:master","ref":"master","sha":"005914e2c076ca8511c3fb690a063ac92d91414b","user":{"login":"vingtetun","id":579794,"avatar_url":"https://avatars.githubusercontent.com/u/579794?v=3","gravatar_id":"","url":"https://api.github.com/users/vingtetun","html_url":"https://github.com/vingtetun","followers_url":"https://api.github.com/users/vingtetun/followers","following_url":"https://api.github.com/users/vingtetun/following{/other_user}","gists_url":"https://api.github.com/users/vingtetun/gists{/gist_id}","starred_url":"https://api.github.com/users/vingtetun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vingtetun/subscriptions","organizations_url":"https://api.github.com/users/vingtetun/orgs","repos_url":"https://api.github.com/users/vingtetun/repos","events_url":"https://api.github.com/users/vingtetun/events{/privacy}","received_events_url":"https://api.github.com/users/vingtetun/received_events","type":"User","site_admin":false},"repo":{"id":34264472,"name":"sw_fm","full_name":"vingtetun/sw_fm","owner":{"login":"vingtetun","id":579794,"avatar_url":"https://avatars.githubusercontent.com/u/579794?v=3","gravatar_id":"","url":"https://api.github.com/users/vingtetun","html_url":"https://github.com/vingtetun","followers_url":"https://api.github.com/users/vingtetun/followers","following_url":"https://api.github.com/users/vingtetun/following{/other_user}","gists_url":"https://api.github.com/users/vingtetun/gists{/gist_id}","starred_url":"https://api.github.com/users/vingtetun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vingtetun/subscriptions","organizations_url":"https://api.github.com/users/vingtetun/orgs","repos_url":"https://api.github.com/users/vingtetun/repos","events_url":"https://api.github.com/users/vingtetun/events{/privacy}","received_events_url":"https://api.github.com/users/vingtetun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vingtetun/sw_fm","description":"","fork":false,"url":"https://api.github.com/repos/vingtetun/sw_fm","forks_url":"https://api.github.com/repos/vingtetun/sw_fm/forks","keys_url":"https://api.github.com/repos/vingtetun/sw_fm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vingtetun/sw_fm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vingtetun/sw_fm/teams","hooks_url":"https://api.github.com/repos/vingtetun/sw_fm/hooks","issue_events_url":"https://api.github.com/repos/vingtetun/sw_fm/issues/events{/number}","events_url":"https://api.github.com/repos/vingtetun/sw_fm/events","assignees_url":"https://api.github.com/repos/vingtetun/sw_fm/assignees{/user}","branches_url":"https://api.github.com/repos/vingtetun/sw_fm/branches{/branch}","tags_url":"https://api.github.com/repos/vingtetun/sw_fm/tags","blobs_url":"https://api.github.com/repos/vingtetun/sw_fm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vingtetun/sw_fm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vingtetun/sw_fm/git/refs{/sha}","trees_url":"https://api.github.com/repos/vingtetun/sw_fm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vingtetun/sw_fm/statuses/{sha}","languages_url":"https://api.github.com/repos/vingtetun/sw_fm/languages","stargazers_url":"https://api.github.com/repos/vingtetun/sw_fm/stargazers","contributors_url":"https://api.github.com/repos/vingtetun/sw_fm/contributors","subscribers_url":"https://api.github.com/repos/vingtetun/sw_fm/subscribers","subscription_url":"https://api.github.com/repos/vingtetun/sw_fm/subscription","commits_url":"https://api.github.com/repos/vingtetun/sw_fm/commits{/sha}","git_commits_url":"https://api.github.com/repos/vingtetun/sw_fm/git/commits{/sha}","comments_url":"https://api.github.com/repos/vingtetun/sw_fm/comments{/number}","issue_comment_url":"https://api.github.com/repos/vingtetun/sw_fm/issues/comments{/number}","contents_url":"https://api.github.com/repos/vingtetun/sw_fm/contents/{+path}","compare_url":"https://api.github.com/repos/vingtetun/sw_fm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vingtetun/sw_fm/merges","archive_url":"https://api.github.com/repos/vingtetun/sw_fm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vingtetun/sw_fm/downloads","issues_url":"https://api.github.com/repos/vingtetun/sw_fm/issues{/number}","pulls_url":"https://api.github.com/repos/vingtetun/sw_fm/pulls{/number}","milestones_url":"https://api.github.com/repos/vingtetun/sw_fm/milestones{/number}","notifications_url":"https://api.github.com/repos/vingtetun/sw_fm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vingtetun/sw_fm/labels{/name}","releases_url":"https://api.github.com/repos/vingtetun/sw_fm/releases{/id}","created_at":"2015-04-20T14:14:14Z","updated_at":"2015-04-20T14:24:43Z","pushed_at":"2015-06-25T09:15:38Z","git_url":"git://github.com/vingtetun/sw_fm.git","ssh_url":"git@github.com:vingtetun/sw_fm.git","clone_url":"https://github.com/vingtetun/sw_fm.git","svn_url":"https://github.com/vingtetun/sw_fm","homepage":null,"size":346,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2"},"html":{"href":"https://github.com/vingtetun/sw_fm/pull/2"},"issue":{"href":"https://api.github.com/repos/vingtetun/sw_fm/issues/2"},"comments":{"href":"https://api.github.com/repos/vingtetun/sw_fm/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/vingtetun/sw_fm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vingtetun/sw_fm/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/vingtetun/sw_fm/statuses/7a4d9f40d2ba3d8cb4e2cb842c76ee843f5f97ff"}}}}