{"action":"created","issue":{"url":"https://api.github.com/repos/nprapps/elections18-graphics/issues/170","repository_url":"https://api.github.com/repos/nprapps/elections18-graphics","labels_url":"https://api.github.com/repos/nprapps/elections18-graphics/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/nprapps/elections18-graphics/issues/170/comments","events_url":"https://api.github.com/repos/nprapps/elections18-graphics/issues/170/events","html_url":"https://github.com/nprapps/elections18-graphics/issues/170","id":369184993,"node_id":"MDU6SXNzdWUzNjkxODQ5OTM=","number":170,"title":"Race condition can break big-board updating","user":{"login":"mileswwatkins","id":4959135,"node_id":"MDQ6VXNlcjQ5NTkxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/4959135?v=4","gravatar_id":"","url":"https://api.github.com/users/mileswwatkins","html_url":"https://github.com/mileswwatkins","followers_url":"https://api.github.com/users/mileswwatkins/followers","following_url":"https://api.github.com/users/mileswwatkins/following{/other_user}","gists_url":"https://api.github.com/users/mileswwatkins/gists{/gist_id}","starred_url":"https://api.github.com/users/mileswwatkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mileswwatkins/subscriptions","organizations_url":"https://api.github.com/users/mileswwatkins/orgs","repos_url":"https://api.github.com/users/mileswwatkins/repos","events_url":"https://api.github.com/users/mileswwatkins/events{/privacy}","received_events_url":"https://api.github.com/users/mileswwatkins/received_events","type":"User","site_admin":false},"labels":[{"id":971644591,"node_id":"MDU6TGFiZWw5NzE2NDQ1OTE=","url":"https://api.github.com/repos/nprapps/elections18-graphics/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1010392266,"node_id":"MDU6TGFiZWwxMDEwMzkyMjY2","url":"https://api.github.com/repos/nprapps/elections18-graphics/labels/effort:light","name":"effort:light","color":"cbc9e2","default":false}],"state":"open","locked":false,"assignee":{"login":"mileswwatkins","id":4959135,"node_id":"MDQ6VXNlcjQ5NTkxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/4959135?v=4","gravatar_id":"","url":"https://api.github.com/users/mileswwatkins","html_url":"https://github.com/mileswwatkins","followers_url":"https://api.github.com/users/mileswwatkins/followers","following_url":"https://api.github.com/users/mileswwatkins/following{/other_user}","gists_url":"https://api.github.com/users/mileswwatkins/gists{/gist_id}","starred_url":"https://api.github.com/users/mileswwatkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mileswwatkins/subscriptions","organizations_url":"https://api.github.com/users/mileswwatkins/orgs","repos_url":"https://api.github.com/users/mileswwatkins/repos","events_url":"https://api.github.com/users/mileswwatkins/events{/privacy}","received_events_url":"https://api.github.com/users/mileswwatkins/received_events","type":"User","site_admin":false},"assignees":[{"login":"mileswwatkins","id":4959135,"node_id":"MDQ6VXNlcjQ5NTkxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/4959135?v=4","gravatar_id":"","url":"https://api.github.com/users/mileswwatkins","html_url":"https://github.com/mileswwatkins","followers_url":"https://api.github.com/users/mileswwatkins/followers","following_url":"https://api.github.com/users/mileswwatkins/following{/other_user}","gists_url":"https://api.github.com/users/mileswwatkins/gists{/gist_id}","starred_url":"https://api.github.com/users/mileswwatkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mileswwatkins/subscriptions","organizations_url":"https://api.github.com/users/mileswwatkins/orgs","repos_url":"https://api.github.com/users/mileswwatkins/repos","events_url":"https://api.github.com/users/mileswwatkins/events{/privacy}","received_events_url":"https://api.github.com/users/mileswwatkins/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-10-11T15:44:09Z","updated_at":"2018-10-12T17:34:36Z","closed_at":null,"author_association":"MEMBER","body":"When the big board receives an update and is performing a redraw, it tries to do a temporary highlight of the candidate cells that have updated. Sometimes it seems there is a race condition, where the cell element is _very_ temporarily not present when the JS is trying to animate it. This causes a JS error, and thus the page to stop refreshing without notice.\r\n\r\nThis error is thrown by\r\n\r\n`const sibling = domNode.parentNode.parentNode.querySelector('.candidate.' + party);`\r\n\r\nin `onUpdateAnimation()` of `/www/js/includes/big-board-core.js`\r\n\r\nLet's handle this simply and elegantly; it's not a big issue if we _don't_ animate on a rare occasion (seemed like 1 in 20 or less frequent).\r\n\r\n---\r\n\r\n<img width=\"961\" alt=\"screen shot 2018-10-11 at 11 41 03\" src=\"https://user-images.githubusercontent.com/4959135/46816455-0383a300-cd4b-11e8-84a5-9fd098af104d.png\">\r\n\r\nand the board gets stuck like so:\r\n\r\n<img width=\"310\" alt=\"screen shot 2018-10-11 at 11 36 46\" src=\"https://user-images.githubusercontent.com/4959135/46816474-0d0d0b00-cd4b-11e8-89da-640ee8b5bf00.png\">\r\n"},"comment":{"url":"https://api.github.com/repos/nprapps/elections18-graphics/issues/comments/429402566","html_url":"https://github.com/nprapps/elections18-graphics/issues/170#issuecomment-429402566","issue_url":"https://api.github.com/repos/nprapps/elections18-graphics/issues/170","id":429402566,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTQwMjU2Ng==","user":{"login":"mileswwatkins","id":4959135,"node_id":"MDQ6VXNlcjQ5NTkxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/4959135?v=4","gravatar_id":"","url":"https://api.github.com/users/mileswwatkins","html_url":"https://github.com/mileswwatkins","followers_url":"https://api.github.com/users/mileswwatkins/followers","following_url":"https://api.github.com/users/mileswwatkins/following{/other_user}","gists_url":"https://api.github.com/users/mileswwatkins/gists{/gist_id}","starred_url":"https://api.github.com/users/mileswwatkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mileswwatkins/subscriptions","organizations_url":"https://api.github.com/users/mileswwatkins/orgs","repos_url":"https://api.github.com/users/mileswwatkins/repos","events_url":"https://api.github.com/users/mileswwatkins/events{/privacy}","received_events_url":"https://api.github.com/users/mileswwatkins/received_events","type":"User","site_admin":false},"created_at":"2018-10-12T17:34:36Z","updated_at":"2018-10-12T17:34:36Z","author_association":"MEMBER","body":"I was wrong about this, it's just that `.candidate.` is not a valid query, but that's what'd happen if `party` wasn't defined. Making sure that `party` falls back to `other`, to handle Sanders and King and others."}}
{"actor":{"display_login":"mileswwatkins"}}