mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +00:00
Ensure we remove broadcast channels after all conditions resolve
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
dcc2bdfd4c
commit
1a8e909a38
1 changed files with 8 additions and 0 deletions
|
@ -3332,6 +3332,10 @@ mod tests {
|
|||
|
||||
model.update(&mut app, |model, ctx| model.inc(ctx));
|
||||
assert_eq!(poll_once(&mut condition2).await, Some(()));
|
||||
|
||||
// Broadcast channel should be removed if no conditions remain on next notification.
|
||||
model.update(&mut app, |_, ctx| ctx.notify());
|
||||
app.update(|ctx| assert!(ctx.async_observations.get(&model.id()).is_none()));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3409,6 +3413,10 @@ mod tests {
|
|||
|
||||
view.update(&mut app, |view, ctx| view.inc(ctx));
|
||||
assert_eq!(poll_once(&mut condition2).await, Some(()));
|
||||
|
||||
// Broadcast channel should be removed if no conditions remain on next notification.
|
||||
view.update(&mut app, |_, ctx| ctx.notify());
|
||||
app.update(|ctx| assert!(ctx.async_observations.get(&view.id()).is_none()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue