{"action":"created","comment":{"url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/comments/90224020","pull_request_review_id":10745141,"id":90224020,"diff_hunk":"@@ -80,36 +80,44 @@ class SeqexecUIApiRoutes(auth: AuthenticationService, q: engine.EventQueue, se:\n \n   def userInRequest(req: Request) = req.attributes.get(JwtAuthentication.authenticatedUser).flatten\n \n-  val protectedServices: HttpService = tokenAuthService { GZip { HttpService {\n-      case req @ GET -> Root / \"seqexec\" / \"events\"         =>\n-        // Stream seqexec events to clients and a ping\n-        val user = userInRequest(req)\n-        WS(Exchange(pingProcess ++ Process.emit(Binary(trimmedArray(SeqexecConnectionOpenEvent(user)))) merge\n-          se.eventProcess(q).map(v => Binary(newTrimmedArray(v))), scalaz.stream.Process.empty))\n-\n-      case req @ POST -> Root / \"seqexec\" / \"logout\"        =>\n-        // Clean the auth cookie\n-        val cookie = Cookie(auth.config.cookieName, \"\", path = \"/\".some,\n-          secure = auth.config.useSSL, maxAge = Some(-1), httpOnly = true)\n-        Ok(\"\").removeCookie(cookie)\n-\n-      case req @ GET -> Root / \"seqexec\" / \"sequence\" / oid =>\n-        val user = userInRequest(req)\n-        user.fold(Unauthorized(Challenge(\"jwt\", \"seqexec\"))) { _ =>\n-          val r = for {\n-            obsId <- \\/.fromTryCatchNonFatal(new SPObservationID(oid)).leftMap((t:Throwable) => Unexpected(t.getMessage))\n-            s     <- se.odbProxy.read(obsId)\n-          } yield (obsId, s)\n-\n-          r match {\n-            case \\/-((i, s)) => se.load(q, i) *>\n-                Ok(List(Sequence(i.stringValue(), SequenceState.NotRunning, \"F2\", s.toSequenceSteps, None)))\n-            case -\\/(e)      => NotFound(SeqexecFailure.explain(e))\n-          }\n-        }\n-    }}\n-\n-  }\n+  val protectedServices: HttpService =\n+    tokenAuthService {\n+      GZip {\n+        HttpService {\n+          case req @ GET -> Root / \"seqexec\" / \"events\"         =>\n+            // Stream seqexec events to clients and a ping\n+            val user = userInRequest(req)\n+            WS(\n+              Exchange(\n+                Process.emit(Binary(trimmedArray(SeqexecConnectionOpenEvent(user)))) ++","path":"modules/edu.gemini.seqexec.web/edu.gemini.seqexec.web.server/src/main/scala/edu/gemini/seqexec/web/server/http4s/SeqexecUIApiRoutes.scala","position":43,"original_position":43,"commit_id":"d6cdcd1d012e95692a5f30ab7916b9b229e0e1a4","original_commit_id":"d6cdcd1d012e95692a5f30ab7916b9b229e0e1a4","user":{"login":"cquiroz","id":3615303,"avatar_url":"https://avatars.githubusercontent.com/u/3615303?v=3","gravatar_id":"","url":"https://api.github.com/users/cquiroz","html_url":"https://github.com/cquiroz","followers_url":"https://api.github.com/users/cquiroz/followers","following_url":"https://api.github.com/users/cquiroz/following{/other_user}","gists_url":"https://api.github.com/users/cquiroz/gists{/gist_id}","starred_url":"https://api.github.com/users/cquiroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cquiroz/subscriptions","organizations_url":"https://api.github.com/users/cquiroz/orgs","repos_url":"https://api.github.com/users/cquiroz/repos","events_url":"https://api.github.com/users/cquiroz/events{/privacy}","received_events_url":"https://api.github.com/users/cquiroz/received_events","type":"User","site_admin":false},"body":"Is the only change to do the `merge` later between `pingProcess` and `se.eventProcess`?","created_at":"2016-11-30T12:37:50Z","updated_at":"2016-11-30T12:37:50Z","html_url":"https://github.com/gemini-hlsw/ocs3/pull/114#discussion_r90224020","pull_request_url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114","_links":{"self":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/comments/90224020"},"html":{"href":"https://github.com/gemini-hlsw/ocs3/pull/114#discussion_r90224020"},"pull_request":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114"}}},"pull_request":{"url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114","id":95751312,"html_url":"https://github.com/gemini-hlsw/ocs3/pull/114","diff_url":"https://github.com/gemini-hlsw/ocs3/pull/114.diff","patch_url":"https://github.com/gemini-hlsw/ocs3/pull/114.patch","issue_url":"https://api.github.com/repos/gemini-hlsw/ocs3/issues/114","number":114,"state":"open","locked":false,"title":"SEQNG-60 Load first Sequence correctly #resolve","user":{"login":"jdnavarro","id":215438,"avatar_url":"https://avatars.githubusercontent.com/u/215438?v=3","gravatar_id":"","url":"https://api.github.com/users/jdnavarro","html_url":"https://github.com/jdnavarro","followers_url":"https://api.github.com/users/jdnavarro/followers","following_url":"https://api.github.com/users/jdnavarro/following{/other_user}","gists_url":"https://api.github.com/users/jdnavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/jdnavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdnavarro/subscriptions","organizations_url":"https://api.github.com/users/jdnavarro/orgs","repos_url":"https://api.github.com/users/jdnavarro/repos","events_url":"https://api.github.com/users/jdnavarro/events{/privacy}","received_events_url":"https://api.github.com/users/jdnavarro/received_events","type":"User","site_admin":false},"body":"Following @cquiroz hints about this bug I found out there was a problem with operator preference. Now it should load the first *Sequence* fine, I tried 3 times in a row and worked on my machine 💻.\r\n\r\nThe `Process` execution is controlled implicitly by `http4s` and I'm pretty sure it creates a different `Process` per websocket. This didn't seem to affect the bug in this PR, but it will be an issue when different users run the Seqexec at the same time.\r\n\r\nWe will have to look into some kind of broadcast mechanism with `scalaz-stream` (*topics*?) in order to make sure all users run only one engine `Process`. So I'm filing a separate ticket for that case.","created_at":"2016-11-29T18:45:50Z","updated_at":"2016-11-30T12:37:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caedc9f281a2cb2bd96b71bde61266ec0b114cd7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114/commits","review_comments_url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114/comments","review_comment_url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gemini-hlsw/ocs3/issues/114/comments","statuses_url":"https://api.github.com/repos/gemini-hlsw/ocs3/statuses/d6cdcd1d012e95692a5f30ab7916b9b229e0e1a4","head":{"label":"jdnavarro:feature/SEQNG-60","ref":"feature/SEQNG-60","sha":"d6cdcd1d012e95692a5f30ab7916b9b229e0e1a4","user":{"login":"jdnavarro","id":215438,"avatar_url":"https://avatars.githubusercontent.com/u/215438?v=3","gravatar_id":"","url":"https://api.github.com/users/jdnavarro","html_url":"https://github.com/jdnavarro","followers_url":"https://api.github.com/users/jdnavarro/followers","following_url":"https://api.github.com/users/jdnavarro/following{/other_user}","gists_url":"https://api.github.com/users/jdnavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/jdnavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdnavarro/subscriptions","organizations_url":"https://api.github.com/users/jdnavarro/orgs","repos_url":"https://api.github.com/users/jdnavarro/repos","events_url":"https://api.github.com/users/jdnavarro/events{/privacy}","received_events_url":"https://api.github.com/users/jdnavarro/received_events","type":"User","site_admin":false},"repo":{"id":62576774,"name":"ocs3","full_name":"jdnavarro/ocs3","owner":{"login":"jdnavarro","id":215438,"avatar_url":"https://avatars.githubusercontent.com/u/215438?v=3","gravatar_id":"","url":"https://api.github.com/users/jdnavarro","html_url":"https://github.com/jdnavarro","followers_url":"https://api.github.com/users/jdnavarro/followers","following_url":"https://api.github.com/users/jdnavarro/following{/other_user}","gists_url":"https://api.github.com/users/jdnavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/jdnavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdnavarro/subscriptions","organizations_url":"https://api.github.com/users/jdnavarro/orgs","repos_url":"https://api.github.com/users/jdnavarro/repos","events_url":"https://api.github.com/users/jdnavarro/events{/privacy}","received_events_url":"https://api.github.com/users/jdnavarro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdnavarro/ocs3","description":"Observatory Control Software - New Generation","fork":true,"url":"https://api.github.com/repos/jdnavarro/ocs3","forks_url":"https://api.github.com/repos/jdnavarro/ocs3/forks","keys_url":"https://api.github.com/repos/jdnavarro/ocs3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdnavarro/ocs3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdnavarro/ocs3/teams","hooks_url":"https://api.github.com/repos/jdnavarro/ocs3/hooks","issue_events_url":"https://api.github.com/repos/jdnavarro/ocs3/issues/events{/number}","events_url":"https://api.github.com/repos/jdnavarro/ocs3/events","assignees_url":"https://api.github.com/repos/jdnavarro/ocs3/assignees{/user}","branches_url":"https://api.github.com/repos/jdnavarro/ocs3/branches{/branch}","tags_url":"https://api.github.com/repos/jdnavarro/ocs3/tags","blobs_url":"https://api.github.com/repos/jdnavarro/ocs3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdnavarro/ocs3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdnavarro/ocs3/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdnavarro/ocs3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdnavarro/ocs3/statuses/{sha}","languages_url":"https://api.github.com/repos/jdnavarro/ocs3/languages","stargazers_url":"https://api.github.com/repos/jdnavarro/ocs3/stargazers","contributors_url":"https://api.github.com/repos/jdnavarro/ocs3/contributors","subscribers_url":"https://api.github.com/repos/jdnavarro/ocs3/subscribers","subscription_url":"https://api.github.com/repos/jdnavarro/ocs3/subscription","commits_url":"https://api.github.com/repos/jdnavarro/ocs3/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdnavarro/ocs3/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdnavarro/ocs3/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdnavarro/ocs3/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdnavarro/ocs3/contents/{+path}","compare_url":"https://api.github.com/repos/jdnavarro/ocs3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdnavarro/ocs3/merges","archive_url":"https://api.github.com/repos/jdnavarro/ocs3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdnavarro/ocs3/downloads","issues_url":"https://api.github.com/repos/jdnavarro/ocs3/issues{/number}","pulls_url":"https://api.github.com/repos/jdnavarro/ocs3/pulls{/number}","milestones_url":"https://api.github.com/repos/jdnavarro/ocs3/milestones{/number}","notifications_url":"https://api.github.com/repos/jdnavarro/ocs3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdnavarro/ocs3/labels{/name}","releases_url":"https://api.github.com/repos/jdnavarro/ocs3/releases{/id}","deployments_url":"https://api.github.com/repos/jdnavarro/ocs3/deployments","created_at":"2016-07-04T16:57:22Z","updated_at":"2016-07-04T16:57:24Z","pushed_at":"2016-11-29T18:31:34Z","git_url":"git://github.com/jdnavarro/ocs3.git","ssh_url":"git@github.com:jdnavarro/ocs3.git","clone_url":"https://github.com/jdnavarro/ocs3.git","svn_url":"https://github.com/jdnavarro/ocs3","homepage":null,"size":4279,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"develop"}},"base":{"label":"gemini-hlsw:develop","ref":"develop","sha":"8b446e426b87d7dabd04e6c6e7dfaaa03a4c856a","user":{"login":"gemini-hlsw","id":8593735,"avatar_url":"https://avatars.githubusercontent.com/u/8593735?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-hlsw","html_url":"https://github.com/gemini-hlsw","followers_url":"https://api.github.com/users/gemini-hlsw/followers","following_url":"https://api.github.com/users/gemini-hlsw/following{/other_user}","gists_url":"https://api.github.com/users/gemini-hlsw/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-hlsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-hlsw/subscriptions","organizations_url":"https://api.github.com/users/gemini-hlsw/orgs","repos_url":"https://api.github.com/users/gemini-hlsw/repos","events_url":"https://api.github.com/users/gemini-hlsw/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-hlsw/received_events","type":"Organization","site_admin":false},"repo":{"id":54653732,"name":"ocs3","full_name":"gemini-hlsw/ocs3","owner":{"login":"gemini-hlsw","id":8593735,"avatar_url":"https://avatars.githubusercontent.com/u/8593735?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-hlsw","html_url":"https://github.com/gemini-hlsw","followers_url":"https://api.github.com/users/gemini-hlsw/followers","following_url":"https://api.github.com/users/gemini-hlsw/following{/other_user}","gists_url":"https://api.github.com/users/gemini-hlsw/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-hlsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-hlsw/subscriptions","organizations_url":"https://api.github.com/users/gemini-hlsw/orgs","repos_url":"https://api.github.com/users/gemini-hlsw/repos","events_url":"https://api.github.com/users/gemini-hlsw/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-hlsw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-hlsw/ocs3","description":"Observatory Control Software - New Generation","fork":false,"url":"https://api.github.com/repos/gemini-hlsw/ocs3","forks_url":"https://api.github.com/repos/gemini-hlsw/ocs3/forks","keys_url":"https://api.github.com/repos/gemini-hlsw/ocs3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-hlsw/ocs3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-hlsw/ocs3/teams","hooks_url":"https://api.github.com/repos/gemini-hlsw/ocs3/hooks","issue_events_url":"https://api.github.com/repos/gemini-hlsw/ocs3/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-hlsw/ocs3/events","assignees_url":"https://api.github.com/repos/gemini-hlsw/ocs3/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-hlsw/ocs3/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-hlsw/ocs3/tags","blobs_url":"https://api.github.com/repos/gemini-hlsw/ocs3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-hlsw/ocs3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-hlsw/ocs3/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-hlsw/ocs3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-hlsw/ocs3/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-hlsw/ocs3/languages","stargazers_url":"https://api.github.com/repos/gemini-hlsw/ocs3/stargazers","contributors_url":"https://api.github.com/repos/gemini-hlsw/ocs3/contributors","subscribers_url":"https://api.github.com/repos/gemini-hlsw/ocs3/subscribers","subscription_url":"https://api.github.com/repos/gemini-hlsw/ocs3/subscription","commits_url":"https://api.github.com/repos/gemini-hlsw/ocs3/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-hlsw/ocs3/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-hlsw/ocs3/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-hlsw/ocs3/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-hlsw/ocs3/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-hlsw/ocs3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-hlsw/ocs3/merges","archive_url":"https://api.github.com/repos/gemini-hlsw/ocs3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-hlsw/ocs3/downloads","issues_url":"https://api.github.com/repos/gemini-hlsw/ocs3/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-hlsw/ocs3/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-hlsw/ocs3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-hlsw/ocs3/labels{/name}","releases_url":"https://api.github.com/repos/gemini-hlsw/ocs3/releases{/id}","deployments_url":"https://api.github.com/repos/gemini-hlsw/ocs3/deployments","created_at":"2016-03-24T15:40:39Z","updated_at":"2016-11-25T15:24:50Z","pushed_at":"2016-11-30T12:33:30Z","git_url":"git://github.com/gemini-hlsw/ocs3.git","ssh_url":"git@github.com:gemini-hlsw/ocs3.git","clone_url":"https://github.com/gemini-hlsw/ocs3.git","svn_url":"https://github.com/gemini-hlsw/ocs3","homepage":null,"size":4368,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114"},"html":{"href":"https://github.com/gemini-hlsw/ocs3/pull/114"},"issue":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/issues/114"},"comments":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/issues/114/comments"},"review_comments":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114/comments"},"review_comment":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/pulls/114/commits"},"statuses":{"href":"https://api.github.com/repos/gemini-hlsw/ocs3/statuses/d6cdcd1d012e95692a5f30ab7916b9b229e0e1a4"}}}}
{"actor":{"display_login":"cquiroz"}}