{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/highland/issues/366","labels_url":"https://api.github.com/repos/caolan/highland/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/caolan/highland/issues/366/comments","events_url":"https://api.github.com/repos/caolan/highland/issues/366/events","html_url":"https://github.com/caolan/highland/issues/366","id":105267369,"number":366,"title":"consume push mutates _consumers list.","user":{"login":"jgrund","id":458717,"avatar_url":"https://avatars.githubusercontent.com/u/458717?v=3","gravatar_id":"","url":"https://api.github.com/users/jgrund","html_url":"https://github.com/jgrund","followers_url":"https://api.github.com/users/jgrund/followers","following_url":"https://api.github.com/users/jgrund/following{/other_user}","gists_url":"https://api.github.com/users/jgrund/gists{/gist_id}","starred_url":"https://api.github.com/users/jgrund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgrund/subscriptions","organizations_url":"https://api.github.com/users/jgrund/orgs","repos_url":"https://api.github.com/users/jgrund/repos","events_url":"https://api.github.com/users/jgrund/events{/privacy}","received_events_url":"https://api.github.com/users/jgrund/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/caolan/highland/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/caolan/highland/milestones/2","html_url":"https://github.com/caolan/highland/milestones/v2.6.0","labels_url":"https://api.github.com/repos/caolan/highland/milestones/2/labels","id":1127912,"number":2,"title":"v2.6.0","description":"","creator":{"login":"vqvu","id":6435429,"avatar_url":"https://avatars.githubusercontent.com/u/6435429?v=3","gravatar_id":"","url":"https://api.github.com/users/vqvu","html_url":"https://github.com/vqvu","followers_url":"https://api.github.com/users/vqvu/followers","following_url":"https://api.github.com/users/vqvu/following{/other_user}","gists_url":"https://api.github.com/users/vqvu/gists{/gist_id}","starred_url":"https://api.github.com/users/vqvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vqvu/subscriptions","organizations_url":"https://api.github.com/users/vqvu/orgs","repos_url":"https://api.github.com/users/vqvu/repos","events_url":"https://api.github.com/users/vqvu/events{/privacy}","received_events_url":"https://api.github.com/users/vqvu/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2015-05-25T03:18:52Z","updated_at":"2015-09-07T21:32:03Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-09-07T21:07:46Z","updated_at":"2015-09-07T21:44:18Z","closed_at":null,"body":"Consider the following code:\r\n\r\n```\r\ns = highland();\r\ns1 = s.map(id).map(id).each(highland.log);\r\ns2 = s.fork().map(id).each(highland.log);\r\ns.end();\r\nfunction id (xs) { return xs; }\r\n```\r\n\r\nThis code throws the following error:\r\n\r\n```\r\nUncaught TypeError: Cannot read property 'write' of undefined\r\n```\r\n\r\nWhat is happening is the consumer is being removed at the same time we are iterating a list of consumers to write to. We should either splice the list of consumers before iterating, or not mutate the consumers list upon getting a nil in `consume`. "},"comment":{"url":"https://api.github.com/repos/caolan/highland/issues/comments/138382755","html_url":"https://github.com/caolan/highland/issues/366#issuecomment-138382755","issue_url":"https://api.github.com/repos/caolan/highland/issues/366","id":138382755,"user":{"login":"jgrund","id":458717,"avatar_url":"https://avatars.githubusercontent.com/u/458717?v=3","gravatar_id":"","url":"https://api.github.com/users/jgrund","html_url":"https://github.com/jgrund","followers_url":"https://api.github.com/users/jgrund/followers","following_url":"https://api.github.com/users/jgrund/following{/other_user}","gists_url":"https://api.github.com/users/jgrund/gists{/gist_id}","starred_url":"https://api.github.com/users/jgrund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgrund/subscriptions","organizations_url":"https://api.github.com/users/jgrund/orgs","repos_url":"https://api.github.com/users/jgrund/repos","events_url":"https://api.github.com/users/jgrund/events{/privacy}","received_events_url":"https://api.github.com/users/jgrund/received_events","type":"User","site_admin":false},"created_at":"2015-09-07T21:44:18Z","updated_at":"2015-09-07T21:44:18Z","body":"Any thoughts on fix? Happy to do a PR."}}