this.data may be undefined when the pressable component is removed#5515
this.data may be undefined when the pressable component is removed#5515vincentfretin wants to merge 1 commit intoaframevr:masterfrom
Conversation
|
It doesn't happen all the time, I had the issue one time over 30 tries I think. :) so it would be hard to test any previous build to see if I reproduce or not. |
|
I'll push an example in a few days. |
|
This is a bug, managed to reproduce it: https://glitch.com/edit/#!/aframe-5515-repro Essentially ticks are called per component type. Removing components of the same type as is currently being processed is tricky. A-Frame would actually randomly skip All of this works fine as long as either:
When the removed component(s) haven't had their |
Description:
I just got a complete freeze in VR because of an error on line
if (distance < this.data.pressDistance) {with this.data undefined.I'm using the pressable component with a custom button component with an additional disabled property that is toggled on pressedstarted and remove the pressable component.
So the issue here is removing a component may still execute tick at least one time it seems. Should this happen? Is this a regression? I don't know.
This is with aframe master Apr 5, 2024 https://cdn.jsdelivr.net/gh/aframevr/aframe@98c706cc0e9d318742f03a20c39cb3b3cc36ce38/dist/aframe-master.min.js
I'm opening the PR mainly for discussion. I know there were recent changes in master related to removing component @mrxz