You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EntityCommands::insert will panic if the entity it is adding a bundle to is removed by any other system in the same tick, unless there's an apply_deferred system that runs between those systems.
This is often very difficult to notice, since the insertion might conflict with an entirely unrelated system that just so happens to also run in the Update schedule. In my particular case, I believe I have accidentally made a preexisting race condition like this much more likely by loosening some unnecessary ordering constraints between some completely unrelated systems.
I believe that EntityCommands::insert could be made much less difficult to use correctly if its behavior with a non-existent entity would instead be to simply do nothing, rather than to panic. This would also match the behavior of EntityCommands::remove and remove_resource, which do nothing when the thing they remove doesn't exist, or when their entity doesn't exist. Thoughts?
The text was updated successfully, but these errors were encountered:
EntityCommands::insert
will panic if the entity it is adding a bundle to is removed by any other system in the same tick, unless there's anapply_deferred
system that runs between those systems.This is often very difficult to notice, since the insertion might conflict with an entirely unrelated system that just so happens to also run in the
Update
schedule. In my particular case, I believe I have accidentally made a preexisting race condition like this much more likely by loosening some unnecessary ordering constraints between some completely unrelated systems.I believe that
EntityCommands::insert
could be made much less difficult to use correctly if its behavior with a non-existent entity would instead be to simply do nothing, rather than to panic. This would also match the behavior ofEntityCommands::remove
andremove_resource
, which do nothing when the thing they remove doesn't exist, or when their entity doesn't exist. Thoughts?The text was updated successfully, but these errors were encountered: