{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/joist/issues/441","repository_url":"https://api.github.com/repos/phetsims/joist","labels_url":"https://api.github.com/repos/phetsims/joist/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/joist/issues/441/comments","events_url":"https://api.github.com/repos/phetsims/joist/issues/441/events","html_url":"https://github.com/phetsims/joist/issues/441","id":256013133,"number":441,"title":"attempt to register the same listener twice for Screen.backgroundColorProperty","user":{"login":"pixelzoom","id":3046552,"avatar_url":"https://avatars1.githubusercontent.com/u/3046552?v=4","gravatar_id":"","url":"https://api.github.com/users/pixelzoom","html_url":"https://github.com/pixelzoom","followers_url":"https://api.github.com/users/pixelzoom/followers","following_url":"https://api.github.com/users/pixelzoom/following{/other_user}","gists_url":"https://api.github.com/users/pixelzoom/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelzoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelzoom/subscriptions","organizations_url":"https://api.github.com/users/pixelzoom/orgs","repos_url":"https://api.github.com/users/pixelzoom/repos","events_url":"https://api.github.com/users/pixelzoom/events{/privacy}","received_events_url":"https://api.github.com/users/pixelzoom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"pixelzoom","id":3046552,"avatar_url":"https://avatars1.githubusercontent.com/u/3046552?v=4","gravatar_id":"","url":"https://api.github.com/users/pixelzoom","html_url":"https://github.com/pixelzoom","followers_url":"https://api.github.com/users/pixelzoom/followers","following_url":"https://api.github.com/users/pixelzoom/following{/other_user}","gists_url":"https://api.github.com/users/pixelzoom/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelzoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelzoom/subscriptions","organizations_url":"https://api.github.com/users/pixelzoom/orgs","repos_url":"https://api.github.com/users/pixelzoom/repos","events_url":"https://api.github.com/users/pixelzoom/events{/privacy}","received_events_url":"https://api.github.com/users/pixelzoom/received_events","type":"User","site_admin":false},"assignees":[{"login":"pixelzoom","id":3046552,"avatar_url":"https://avatars1.githubusercontent.com/u/3046552?v=4","gravatar_id":"","url":"https://api.github.com/users/pixelzoom","html_url":"https://github.com/pixelzoom","followers_url":"https://api.github.com/users/pixelzoom/followers","following_url":"https://api.github.com/users/pixelzoom/following{/other_user}","gists_url":"https://api.github.com/users/pixelzoom/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelzoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelzoom/subscriptions","organizations_url":"https://api.github.com/users/pixelzoom/orgs","repos_url":"https://api.github.com/users/pixelzoom/repos","events_url":"https://api.github.com/users/pixelzoom/events{/privacy}","received_events_url":"https://api.github.com/users/pixelzoom/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-09-07T17:27:51Z","updated_at":"2017-09-07T17:29:39Z","closed_at":null,"author_association":"NONE","body":"Related to https://github.com/phetsims/axon/issues/140 (Phase 2: remove the guard from Property.link).\r\n\r\nIn Sim.js:\r\n\r\n```js\r\n      screens.forEach( function initializeScreen( screen ) {\r\n        workItems.push( function() {\r\n667       screen.backgroundColorProperty.link( self.updateBackground );\r\n          screen.initializeModel();\r\n        } );\r\n        workItems.push( function() {\r\n          screen.initializeView();\r\n        } );\r\n      } );\r\n```\r\n\r\nIf Screens share the same instance for `backgroundColorProperty`, then line 667 above will result in an attempt to register the same listener twice. \r\n\r\nWe'll need to resolve this before proceeding with sim testing for https://github.com/phetsims/axon/issues/140."},"comment":{"url":"https://api.github.com/repos/phetsims/joist/issues/comments/327868938","html_url":"https://github.com/phetsims/joist/issues/441#issuecomment-327868938","issue_url":"https://api.github.com/repos/phetsims/joist/issues/441","id":327868938,"user":{"login":"pixelzoom","id":3046552,"avatar_url":"https://avatars1.githubusercontent.com/u/3046552?v=4","gravatar_id":"","url":"https://api.github.com/users/pixelzoom","html_url":"https://github.com/pixelzoom","followers_url":"https://api.github.com/users/pixelzoom/followers","following_url":"https://api.github.com/users/pixelzoom/following{/other_user}","gists_url":"https://api.github.com/users/pixelzoom/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelzoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelzoom/subscriptions","organizations_url":"https://api.github.com/users/pixelzoom/orgs","repos_url":"https://api.github.com/users/pixelzoom/repos","events_url":"https://api.github.com/users/pixelzoom/events{/privacy}","received_events_url":"https://api.github.com/users/pixelzoom/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T17:29:39Z","updated_at":"2017-09-07T17:29:39Z","author_association":"NONE","body":"Proposed fix:\r\n\r\n```js\r\n667       screen.backgroundColorProperty.link( self.updateBackground );\r\n```\r\n\r\nto:\r\n\r\n```js\r\n     // Screens may share the same instance of backgroundProperty, see joist#441\r\n     if ( !screen.backgroundProperty.hasListener( self.updateBackground ) ) {\r\n      screen.backgroundColorProperty.link( self.updateBackground );\r\n    }\r\n```\r\n\r\n@samreid @jonathanolson any objections?"}}
{"actor":{"display_login":"pixelzoom"}}