{"action":"created","issue":{"url":"https://api.github.com/repos/WebAudio/web-midi-api/issues/79","labels_url":"https://api.github.com/repos/WebAudio/web-midi-api/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/WebAudio/web-midi-api/issues/79/comments","events_url":"https://api.github.com/repos/WebAudio/web-midi-api/issues/79/events","html_url":"https://github.com/WebAudio/web-midi-api/issues/79","id":19050979,"number":79,"title":"MIDI input/output disconnection - Ports should be persistent across connects/disconnects","user":{"login":"cwilso","id":507001,"avatar_url":"https://avatars.githubusercontent.com/u/507001?v=3","gravatar_id":"","url":"https://api.github.com/users/cwilso","html_url":"https://github.com/cwilso","followers_url":"https://api.github.com/users/cwilso/followers","following_url":"https://api.github.com/users/cwilso/following{/other_user}","gists_url":"https://api.github.com/users/cwilso/gists{/gist_id}","starred_url":"https://api.github.com/users/cwilso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwilso/subscriptions","organizations_url":"https://api.github.com/users/cwilso/orgs","repos_url":"https://api.github.com/users/cwilso/repos","events_url":"https://api.github.com/users/cwilso/events{/privacy}","received_events_url":"https://api.github.com/users/cwilso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"cwilso","id":507001,"avatar_url":"https://avatars.githubusercontent.com/u/507001?v=3","gravatar_id":"","url":"https://api.github.com/users/cwilso","html_url":"https://github.com/cwilso","followers_url":"https://api.github.com/users/cwilso/followers","following_url":"https://api.github.com/users/cwilso/following{/other_user}","gists_url":"https://api.github.com/users/cwilso/gists{/gist_id}","starred_url":"https://api.github.com/users/cwilso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwilso/subscriptions","organizations_url":"https://api.github.com/users/cwilso/orgs","repos_url":"https://api.github.com/users/cwilso/repos","events_url":"https://api.github.com/users/cwilso/events{/privacy}","received_events_url":"https://api.github.com/users/cwilso/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/WebAudio/web-midi-api/milestones/2","html_url":"https://github.com/WebAudio/web-midi-api/milestones/V1","labels_url":"https://api.github.com/repos/WebAudio/web-midi-api/milestones/2/labels","id":294310,"number":2,"title":"V1","description":"","creator":{"login":"cwilso","id":507001,"avatar_url":"https://avatars.githubusercontent.com/u/507001?v=3","gravatar_id":"","url":"https://api.github.com/users/cwilso","html_url":"https://github.com/cwilso","followers_url":"https://api.github.com/users/cwilso/followers","following_url":"https://api.github.com/users/cwilso/following{/other_user}","gists_url":"https://api.github.com/users/cwilso/gists{/gist_id}","starred_url":"https://api.github.com/users/cwilso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwilso/subscriptions","organizations_url":"https://api.github.com/users/cwilso/orgs","repos_url":"https://api.github.com/users/cwilso/repos","events_url":"https://api.github.com/users/cwilso/events{/privacy}","received_events_url":"https://api.github.com/users/cwilso/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":10,"state":"open","created_at":"2013-03-22T22:44:06Z","updated_at":"2015-02-24T21:00:50Z","due_on":null,"closed_at":null},"comments":28,"created_at":"2013-09-05T15:32:43Z","updated_at":"2015-03-04T21:33:00Z","closed_at":null,"body":"Reported externally:\r\n-------------\r\nWhat is the exact workflow when a MIDI input disconnects? Suppose I'm listening on port 2, which is connected at start, setting onmidimessage appropriately.\r\nThen port 2 disconnects (I receive a disconnect event on my ondisconnect handler) - What is the fate of my onmidimessage port 2 handler?\r\nIf input 2 re-connects, should I re-set the appropriate onmidimessage handler to listen for midi events on port 2, or, having set it before, the old handler (set before disconnection and reconnection) will still work?\r\n------------\r\n\r\nI *think* that when a port disconnects, it should release the event handler and the object, and they should not become live again, even when reconnected.  At the same time, the Maplike rearchitecture may change this, since that port would be the same as the previous port.  Discuss."},"comment":{"url":"https://api.github.com/repos/WebAudio/web-midi-api/issues/comments/77253792","html_url":"https://github.com/WebAudio/web-midi-api/issues/79#issuecomment-77253792","issue_url":"https://api.github.com/repos/WebAudio/web-midi-api/issues/79","id":77253792,"user":{"login":"agoode","id":59842,"avatar_url":"https://avatars.githubusercontent.com/u/59842?v=3","gravatar_id":"","url":"https://api.github.com/users/agoode","html_url":"https://github.com/agoode","followers_url":"https://api.github.com/users/agoode/followers","following_url":"https://api.github.com/users/agoode/following{/other_user}","gists_url":"https://api.github.com/users/agoode/gists{/gist_id}","starred_url":"https://api.github.com/users/agoode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agoode/subscriptions","organizations_url":"https://api.github.com/users/agoode/orgs","repos_url":"https://api.github.com/users/agoode/repos","events_url":"https://api.github.com/users/agoode/events{/privacy}","received_events_url":"https://api.github.com/users/agoode/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T21:33:00Z","updated_at":"2015-03-04T21:33:00Z","body":"Ok.\r\n\r\nPort present? | Port opened? | State name, @cwilso proposal\r\n----|----|----\r\nno | no | `not present`\r\nno | yes | `disconnected` \r\nyes | no | `connected`\r\nyes | yes | `opened`\r\n\r\nI'm having a hard time feeling great about the state names. It's confusing to me because there are 2 parallel sets of states (one set from the hardware, one set from the client) we are trying to collapse into a single string. I'm not proposing any replacement names though, since I don't have anything better.\r\n\r\nI think if we keep pressing on the corner cases of the state machine, we'll figure it all out."}}