{"action":"opened","issue":{"url":"https://api.github.com/repos/tangrams/tangram-es/issues/1704","repository_url":"https://api.github.com/repos/tangrams/tangram-es","labels_url":"https://api.github.com/repos/tangrams/tangram-es/issues/1704/labels{/name}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/issues/1704/comments","events_url":"https://api.github.com/repos/tangrams/tangram-es/issues/1704/events","html_url":"https://github.com/tangrams/tangram-es/issues/1704","id":266659501,"number":1704,"title":"Most recent scene yaml should be applied when all onSceneReady calls finish","user":{"login":"sarahlensing","id":494323,"avatar_url":"https://avatars2.githubusercontent.com/u/494323?v=4","gravatar_id":"","url":"https://api.github.com/users/sarahlensing","html_url":"https://github.com/sarahlensing","followers_url":"https://api.github.com/users/sarahlensing/followers","following_url":"https://api.github.com/users/sarahlensing/following{/other_user}","gists_url":"https://api.github.com/users/sarahlensing/gists{/gist_id}","starred_url":"https://api.github.com/users/sarahlensing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarahlensing/subscriptions","organizations_url":"https://api.github.com/users/sarahlensing/orgs","repos_url":"https://api.github.com/users/sarahlensing/repos","events_url":"https://api.github.com/users/sarahlensing/events{/privacy}","received_events_url":"https://api.github.com/users/sarahlensing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-18T22:14:28Z","updated_at":"2017-10-18T22:14:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:**\r\n\r\n0. Get reference to `MapController` with `MapView#getMap(SceneLoadListener)`\r\n1. Call `MapController#loadSceneYamlAsync` with bubble wrap yaml\r\n2. After onSceneReady callback received\r\n3. Call `MapController#updateSceneAsync` with path overlay scene updates\r\n4. Call `MapController#loadSceneYaml` with cinnabar yaml\r\n5. Receive `onSceneReady` `MapController#loadSceneYaml`\r\n6. Receive `onSceneReady` `MapController#updateSceneAsync`\r\n\r\n**RESULT:**\r\n\r\nThe map style displayed is bubble wrap\r\n\r\n**EXPECTED RESULT:**\r\n\r\nI expect cinnabar to be displayed because it was the most recent style yaml set on `MapController`\r\n\r\n**ENVIRONMENT:**\r\n\r\nTangram 0.8.1\r\nAndroid 7.0\r\n\r\n**OTHER:**\r\n\r\nNote that when I replace call 4. `MapController#loadSceneYaml` with the async `MapController#loadSceneYamlAsync` method, the callbacks to onSceneReady finish in the same order as they were called (and the style is set to cinnabar as expected). Also, if I add a delay before the call to 4. to allow the previous scene updates to finish, cinnabar is set properly.\r\n\r\nThis makes me wonder if we should add a way to cancel previously made asynchronous calls? If we did this, I'd imagine it would then be the developer's responsibility to cancel existing async calls before making any sync calls. Alternatively, we could enforce ordering within Tangram so that sync calls wouldn't happen until previously queued async ones finished. Or something else entirely?\r\n\r\nSince its common to see methods to cancel async operations (https://developer.apple.com/documentation/foundation/nsoperationqueue/1417849-cancelalloperations?language=objc, https://developer.android.com/reference/android/os/Handler.html#removeCallbacks(java.lang.Runnable)), I prefer we add something like `MapController#cancelSceneLoad(sceneId)`. \r\n\r\nNote that the synchronous call in 4. was only made in the sample app to test how the Android SDK responded after I found a bug in the iOS SDK, we don't recommend devs use these methods. That said, if there is anything we should be doing differently in the Android SDK, let me know."}}
{"actor":{"display_login":"sarahlensing"}}