Remove unnecessary waiting when handling save RPC requests
Add saving to the randomized integration test Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
3315750361
commit
e3c4ce208a
4 changed files with 22 additions and 24 deletions
|
@ -2289,11 +2289,12 @@ impl Project {
|
|||
Ok::<_, anyhow::Error>((project_id, buffer))
|
||||
})?;
|
||||
|
||||
buffer
|
||||
.update(&mut cx, |buffer, _| {
|
||||
buffer.wait_for_version(requested_version)
|
||||
})
|
||||
.await;
|
||||
if !buffer
|
||||
.read_with(&cx, |buffer, _| buffer.version())
|
||||
.observed_all(&requested_version)
|
||||
{
|
||||
Err(anyhow!("save request depends on unreceived edits"))?;
|
||||
}
|
||||
|
||||
let (saved_version, mtime) = buffer.update(&mut cx, |buffer, cx| buffer.save(cx)).await?;
|
||||
Ok(proto::BufferSaved {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue