Scheduler lock-up when combining `after` and `chain()`
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
0.12.1 (-F dynamic_linking)
## What you did
Source code (36 lines)
```rust
#![allow(clippy::needless_pass_by_value)]
use bevy::prelude::*;
#[derive(Resource)]
pub struct MyTimer(pub Timer);
fn fn_a(time: Res
fn fn_b(mut commands: Commands, timer: ResMut) {
println!("b called");
if !timer.0.just_finished() {
return;
}
println!("b works");
}
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.insert_resource(MyTimer(Timer::from_seconds(0.2, TimerMode::Repeating)))
.add_systems(
Update,
(
apply_deferred.after(fn_a), // this line causes a lockup
// fn_a, // uncomment these lines
// apply_deferred, // and it will run properly
fn_b,
)
.chain(),
)
.run();
}
```
## What went wrong
System `fn_a` is never run (and therefore never frees up the timer for b to perform work - even though b is run)
Contributor guide
Assessment
This issue has not been assessed yet.