Skip to content

Asset has LoadState::Loaded but Assets::get return None #2224

@kgv

Description

@kgv

Bevy version

0.5.0.

Operating system & version

Windows 10.

What you did

  1. Insert code before this line (using debug branch):
warn!(
    "resource_handle: {:?} {:?} {}",
    resource_handle,
    asset_server.get_load_state(resource_handle.clone()),
    resource_assets.get(resource_handle).is_some(),
);
  1. Run the ui example (cargo run --example=ui).

  2. If you manually click on the language change buttons, then everything is ok.
    But if you use a mouse macro (or something else) for a very fast click, then the example ends with an error.

  3. Log output:

WARN bevy_fluent::assets::localization: resource_handle: StrongHandle<ResourceAsset>(AssetPathId(AssetPathId(SourcePathId(17015584791912148938), LabelId(6298619649789039366)))) Loaded true
WARN bevy_fluent::assets::localization: resource_handle: StrongHandle<ResourceAsset>(AssetPathId(AssetPathId(SourcePathId(2475016618522967226), LabelId(6298619649789039366)))) Loaded true
WARN bevy_fluent::assets::localization: resource_handle: StrongHandle<ResourceAsset>(AssetPathId(AssetPathId(SourcePathId(17610828258912988862), LabelId(6298619649789039366)))) Loaded false
WARN bevy_fluent::assets::localization: resource_handle: StrongHandle<ResourceAsset>(AssetPathId(AssetPathId(SourcePathId(17872065453730569751), LabelId(6298619649789039366)))) Loaded false

You can see that the last two assets will have the status Loaded but get method return None.

What you expected to happen

For each asset that has LoadState::Loaded status, Assets.get always return Some.

What actually happened

You can see that some assets will have the status Loaded but get method return None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions