Introduce completed_scan_id to worktree

We need to know the most recent scan id we have actually completed. This is to
handle the case where a guest disconnects when we're in the middle of streaming
worktree entries to them. When they reconnect, they need to report a scan_id
from before we started streaming the entries, because we have no record of when
the stream was interrupted.

Next failure:
SEED=5051 ITERATIONS=1 OPERATIONS=200 cargo test --release --package=collab random -- --nocapture
This commit is contained in:
Nathan Sobo 2023-01-03 18:26:57 -07:00
parent 90fb9b53ad
commit 1dd085fc92
3 changed files with 27 additions and 7 deletions

View file

@ -382,7 +382,7 @@ impl Room {
let worktree = worktree.read(cx);
proto::RejoinWorktree {
id: worktree.id().to_proto(),
scan_id: worktree.scan_id() as u64,
scan_id: worktree.completed_scan_id() as u64,
}
})
.collect(),