{"action":"created","issue":{"url":"https://api.github.com/repos/Esri/esri-leaflet-renderers/issues/105","repository_url":"https://api.github.com/repos/Esri/esri-leaflet-renderers","labels_url":"https://api.github.com/repos/Esri/esri-leaflet-renderers/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/Esri/esri-leaflet-renderers/issues/105/comments","events_url":"https://api.github.com/repos/Esri/esri-leaflet-renderers/issues/105/events","html_url":"https://github.com/Esri/esri-leaflet-renderers/issues/105","id":129267669,"number":105,"title":"Race condition in 2.0.0-beta.7","user":{"login":"PatrickKing","id":957612,"avatar_url":"https://avatars.githubusercontent.com/u/957612?v=3","gravatar_id":"","url":"https://api.github.com/users/PatrickKing","html_url":"https://github.com/PatrickKing","followers_url":"https://api.github.com/users/PatrickKing/followers","following_url":"https://api.github.com/users/PatrickKing/following{/other_user}","gists_url":"https://api.github.com/users/PatrickKing/gists{/gist_id}","starred_url":"https://api.github.com/users/PatrickKing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PatrickKing/subscriptions","organizations_url":"https://api.github.com/users/PatrickKing/orgs","repos_url":"https://api.github.com/users/PatrickKing/repos","events_url":"https://api.github.com/users/PatrickKing/events{/privacy}","received_events_url":"https://api.github.com/users/PatrickKing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-27T21:04:41Z","updated_at":"2016-03-09T23:41:49Z","closed_at":null,"body":"Hi all, \r\n\r\nI'm seeing a race condition, where if map updates occur while a feature layer is loading, the layer accesses some variables which have not been initialized yet and crashes.\r\n\r\nI've [reproduced the problem a gist](https://gist.github.com/PatrickKing/1185c9584cf1e521d8c7). A feature layer is loaded and unloaded at 5 second intervals, and the crash occurs when we call `map.setZoom`.\r\n\r\nNot 100% sure this is from esri-leaflet-renderers, but the exception no longer occurs if you comment the line importing renderers in the gist.\r\n\r\nThanks!\r\n\r\nEdited to add: For some context, we are using react-leaflet. React has asynchronous event systems which operate in the background, with the result that we encounter this issue reliably in our app. I didn't go hunting for obscure race conditions at random. "},"comment":{"url":"https://api.github.com/repos/Esri/esri-leaflet-renderers/issues/comments/194569420","html_url":"https://github.com/Esri/esri-leaflet-renderers/issues/105#issuecomment-194569420","issue_url":"https://api.github.com/repos/Esri/esri-leaflet-renderers/issues/105","id":194569420,"user":{"login":"kneemer","id":30075,"avatar_url":"https://avatars.githubusercontent.com/u/30075?v=3","gravatar_id":"","url":"https://api.github.com/users/kneemer","html_url":"https://github.com/kneemer","followers_url":"https://api.github.com/users/kneemer/followers","following_url":"https://api.github.com/users/kneemer/following{/other_user}","gists_url":"https://api.github.com/users/kneemer/gists{/gist_id}","starred_url":"https://api.github.com/users/kneemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kneemer/subscriptions","organizations_url":"https://api.github.com/users/kneemer/orgs","repos_url":"https://api.github.com/users/kneemer/repos","events_url":"https://api.github.com/users/kneemer/events{/privacy}","received_events_url":"https://api.github.com/users/kneemer/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T23:41:49Z","updated_at":"2016-03-09T23:41:49Z","body":"@jgravois I'm occasionally seeing behavior where the renderer is not applied to all features and am wondering if it is due to this change.  I didn't see the issue before."}}