Files
benilla-octo/crates/benilla-world
gromandClaude Opus 5 f434cc9916 Survive a net entity despawned before attach's queue is applied
grom's 06:23 session died 183 s in on first world entry
(Diagnostics/crash-1792671984.txt): insert::<GroundShade> on 4431v0, "its
index now has generation 1", one frame after a 4301 ms world-entry hitch
during which the server sent a burst of creates and destroys.

The mechanism is structural, not a one-off. A command queue is applied at the
schedule's next sync point, not when the system returns, so a destroy handled
by a system that ran *earlier* in the same frame is still only queued while
attach_entity_visuals' query runs: the row looks alive, the whole visual is
built for it, and the despawn lands first at the sync point. The panicking
command form then kills the client for an entity the server had already taken
away.

So every write this system makes onto the net entity root is now a try_
command. add_child was the one that needed more than a rename: it queues its
command on the *parent*, so the conform node and RigPose::anchor_for's bone
anchors are related at spawn with ChildOf instead — the relationship hook
tolerates a missing target where a command on it does not.

The test builds a CommandQueue the way the existing rig test does, despawns the
root before applying it, and asserts the entity stays gone. It fails with
grom's exact panic text when any single write is put back, which is how I know
it bites.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 07:41:59 -06:00
..