{"action":"created","issue":{"url":"https://api.github.com/repos/jupyter/jupyter-js-services/issues/233","repository_url":"https://api.github.com/repos/jupyter/jupyter-js-services","labels_url":"https://api.github.com/repos/jupyter/jupyter-js-services/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/jupyter/jupyter-js-services/issues/233/comments","events_url":"https://api.github.com/repos/jupyter/jupyter-js-services/issues/233/events","html_url":"https://github.com/jupyter/jupyter-js-services/issues/233","id":181087821,"number":233,"title":"Issue with Kernel.connectTo and Comms","user":{"login":"AlexTugarev","id":914497,"avatar_url":"https://avatars.githubusercontent.com/u/914497?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexTugarev","html_url":"https://github.com/AlexTugarev","followers_url":"https://api.github.com/users/AlexTugarev/followers","following_url":"https://api.github.com/users/AlexTugarev/following{/other_user}","gists_url":"https://api.github.com/users/AlexTugarev/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexTugarev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexTugarev/subscriptions","organizations_url":"https://api.github.com/users/AlexTugarev/orgs","repos_url":"https://api.github.com/users/AlexTugarev/repos","events_url":"https://api.github.com/users/AlexTugarev/events{/privacy}","received_events_url":"https://api.github.com/users/AlexTugarev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-05T08:00:08Z","updated_at":"2016-10-05T15:37:34Z","closed_at":null,"body":"Consider the following situation:\r\n- a session+kernel is created for a console\r\n- a custom widget which … \r\n - connects to a running kernel via `IServiceManager.kernels.connectTo`\r\n - connects a Comm to the second kernel client\r\n\r\nWhen the kernel sends a Comm message, each time this message is processed in `Kernel. _handleCommMsg` ([L874](https://github.com/jupyter/jupyter-js-services/blob/master/src/kernel/default.ts#L874)) by the first kernel client instance which was created for the console, errors are printed to the console. Assuming this is a valid use of the API, how could this situation be handled without errors?\r\n\r\nThe sneaky question about `IKernel.IManager` is, what do you think about providing the managed `IKernel` instances? `IKernel.IManager.connectTo` will clone an existing kernel client, and therefore create a second websocket connection and so on. At least for the use with Comm, we see the need to just use an existing kernel client and connect a Comm."},"comment":{"url":"https://api.github.com/repos/jupyter/jupyter-js-services/issues/comments/251711751","html_url":"https://github.com/jupyter/jupyter-js-services/issues/233#issuecomment-251711751","issue_url":"https://api.github.com/repos/jupyter/jupyter-js-services/issues/233","id":251711751,"user":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T15:37:34Z","updated_at":"2016-10-05T15:37:34Z","body":"Hi @AlexTugarev, for the first question, I think the right answer here to is to also match against the local `clientId` using the message header before printing that error.\r\n\r\nAs for the second question, we have purposely kept them separate since each is a different \"client\".  Your options are to 1) Use the original kernel object itself or 2) Provide the `clientId` of the original kernel object.\r\n\r\nIn the context of JupyterLab, you can get the `kernel` of an existing notebook by creating a `widgetExtension` for notebook widgets, similar to what the [jupyterlab_widgets](https://github.com/ipython/ipywidgets/blob/master/jupyterlab_widgets/src/plugin.ts#L58) extension does.\r\n\r\n"}}
{"actor":{"display_login":"blink1073"}}