Skip to content

Synctest session doesn't detect all desyncs that it could/should #108

Closed

Description

@johanhelsing

Describe the bug

If the user forgets to register a component for rollback, this may cause a problem when the entity is despawned which is not detected by synctest sessions.

For instance. Let's say the user forgets to register a marker component, Bullet.

If a system despawns the bullet:

fn despawn_bullets(
    mut commands: Commands,
    bullets: Query<Entity, With<Bullet>>,
) {
    for bullet in &bullets {
        info!("despawning bullet {bullet:?}");
        commands.entity(bullet).despawn_recursive();
    }
}

This is desync bug, because restoring the bullet entity will not restore the Bullet component.

However, this is not detected by the synctest session. It happily restores the bullet entity without the Bullet component and doesn't report any desyncs.

It looks like the synctest session rolls back before it stores the latest checksum. It might be that something is wrong wrt the order we do things.

To Reproduce

  1. Check out https://github.com/johanhelsing/extreme_bevy/tree/bevy-ggrs-synctest-bug
  2. run it with --synctest
  3. Kill one player to trigger a new round

Bullets remain on screen, likely without the Bullet component, and no desync errors are printed

Expected behavior

Running the synctest session should trigger an error

Activity

  1. gschup commented on Mar 21, 2026

    @gschup
    Owner

    PR #127 (despawn via disabling component) directly addresses the core case here. By never truly removing rollback entities from the world, all components — registered or not — are preserved through rollback. The missing-component desync you described would be naturally avoided once that PR is merged.

    Leaving this open until #127 lands.

  2. gschup commented on Apr 9, 2026

    @gschup
    Owner

    Resolved by #127 (merged): entities are never truly removed via , so all components survive rollback and desyncs from unregistered components on despawned entities are no longer possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions