Remove update_id from worktree update messages
We don't need this anymore because worktree updates are foreground messages. Co-Authored-By: Nathan Sobo <nathan@zed.dev> Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
f3c6320eeb
commit
8440644dc9
5 changed files with 14 additions and 67 deletions
|
@ -350,7 +350,6 @@ impl Server {
|
|||
.cloned()
|
||||
.collect(),
|
||||
weak: worktree.weak,
|
||||
next_update_id: share.next_update_id as u64,
|
||||
})
|
||||
})
|
||||
.collect();
|
||||
|
@ -489,7 +488,6 @@ impl Server {
|
|||
request.sender_id,
|
||||
entries,
|
||||
diagnostic_summaries,
|
||||
worktree.next_update_id,
|
||||
)?;
|
||||
|
||||
broadcast(
|
||||
|
@ -513,7 +511,6 @@ impl Server {
|
|||
request.sender_id,
|
||||
request.payload.project_id,
|
||||
request.payload.worktree_id,
|
||||
request.payload.id,
|
||||
&request.payload.removed_entries,
|
||||
&request.payload.updated_entries,
|
||||
)?;
|
||||
|
|
|
@ -43,7 +43,6 @@ pub struct ProjectShare {
|
|||
pub struct WorktreeShare {
|
||||
pub entries: HashMap<u64, proto::Entry>,
|
||||
pub diagnostic_summaries: BTreeMap<PathBuf, proto::DiagnosticSummary>,
|
||||
pub next_update_id: u64,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -404,7 +403,6 @@ impl Store {
|
|||
connection_id: ConnectionId,
|
||||
entries: HashMap<u64, proto::Entry>,
|
||||
diagnostic_summaries: BTreeMap<PathBuf, proto::DiagnosticSummary>,
|
||||
next_update_id: u64,
|
||||
) -> tide::Result<SharedWorktree> {
|
||||
let project = self
|
||||
.projects
|
||||
|
@ -418,7 +416,6 @@ impl Store {
|
|||
worktree.share = Some(WorktreeShare {
|
||||
entries,
|
||||
diagnostic_summaries,
|
||||
next_update_id,
|
||||
});
|
||||
Ok(SharedWorktree {
|
||||
authorized_user_ids: project.authorized_user_ids(),
|
||||
|
@ -537,7 +534,6 @@ impl Store {
|
|||
connection_id: ConnectionId,
|
||||
project_id: u64,
|
||||
worktree_id: u64,
|
||||
update_id: u64,
|
||||
removed_entries: &[u64],
|
||||
updated_entries: &[proto::Entry],
|
||||
) -> tide::Result<Vec<ConnectionId>> {
|
||||
|
@ -549,11 +545,6 @@ impl Store {
|
|||
.share
|
||||
.as_mut()
|
||||
.ok_or_else(|| anyhow!("worktree is not shared"))?;
|
||||
if share.next_update_id != update_id {
|
||||
return Err(anyhow!("received worktree updates out-of-order"))?;
|
||||
}
|
||||
|
||||
share.next_update_id = update_id + 1;
|
||||
for entry_id in removed_entries {
|
||||
share.entries.remove(&entry_id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue