-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Description:
Chrome seems to run detachedCallback synchronously when an entity is removed. This causes component ticks to be removed from the behaviors array during the tick, which in turn causes ticks to be missed, since the array is being mutated while its being iterated.
Firefox on the other hand seems to call detachedCallback asynchronously, after a tick.
I've opened PR #4165 with a failing test case and you can see a visual demonstration of the bug by opening the following glitch.me link in Firefox and Chrome. The demonstration contains a scene with multiple entities. The entities all have a component on them that removes its own entity from the scene, and there is a component on the scene that pauses the scene after the first frame to show the skipped ticks. In Chrome, only two of the four entities are removed from the scene in the first tick, but in Firefox, all of the entities are removed as expected.
I'm not sure whether this should be considered a bug in the document-register-element polyfill (assuming it's in effect here), or if the behaviors iteration should be fixed to account for array mutation.
- A-Frame Version: 0.9.2 & master
- Platform / Device: Windows & Android, Firefox and Chrome. Haven't tested Safari.
- Reproducible Code Snippet or URL: https://aframe-tick-bug.glitch.me/