bevy/crates/bevy_asset/src
Greeble 05d954e1ab
Add test that repros #11111 (different loader settings produce same asset) (#19094)
## Objective

Add a test that reproduces #11111 (and partially #18267). The bug is
that asset loader settings are effectively ignored if the same asset is
loaded multiple times with different settings.

## Solution

Add a unit test to `bevy_assets/lib.rs`. The test will be marked as
`#[ignore]` until #11111 is fixed.

```rust
// Load the same asset with different settings.

let handle_1 = load(asset_server, "test.u8", 1);
let handle_2 = load(asset_server, "test.u8", 2);

// Handles should be different.

assert_ne!(handle_1, handle_2);
```

## Concerns

I'm not 100% sure that the current behaviour is actually broken - I
can't see anything in the asset system design docs that explicitly says
different settings should create different asset ids.

UPDATE: Sentiment from issue comments and discord varies between "bug"
and "undesirable consequence of design decisions, alternatives should be
explored". So I've concluded that the test is valid and desirable.

## Testing

```sh
cargo test -p bevy_asset --features multi_threaded

# Or to repro the issue:
cargo test -p bevy_asset --features multi_threaded -- --ignored
```
2025-07-02 22:39:04 +00:00
..
io bevy_asset: fix clippy in wasm (#19865) 2025-06-29 20:36:53 +00:00
processor Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
server Restructure the logic in AssetServer::load_internal to avoid using weak handles. (#19634) 2025-06-30 22:39:59 +00:00
asset_changed.rs Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00
assets.rs Add get_mut_untracked to Assets (#19487) 2025-06-04 16:34:27 +00:00
direct_access_ext.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
event.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
folder.rs
handle.rs Replace Handle::Weak with Handle::Uuid. (#19896) 2025-07-02 14:40:35 +00:00
id.rs Added derive Reflect to UntypedHandle and UntypedAssetId (#18827) 2025-04-28 21:46:36 +00:00
lib.rs Add test that repros #11111 (different loader settings produce same asset) (#19094) 2025-07-02 22:39:04 +00:00
loader_builders.rs Revert PR #15481 to resolve a regression. (#18567) 2025-03-27 21:32:01 +00:00
loader.rs Fix LoadContext docs. (#19610) 2025-06-13 03:48:55 +00:00
meta.rs
path.rs Remove apostrophes in possessive its (#19244) 2025-05-26 19:53:14 +00:00
reflect.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
render_asset.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
saver.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
transformer.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00