Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Antonio Scandurra
a734b20a01 zed 0.70.1 2023-01-27 11:03:52 +01:00
Antonio Scandurra
71073d0f32 Merge pull request #2103 from zed-industries/connection-staleness
Fix connection staleness issues
2023-01-27 11:03:01 +01:00
Joseph Lyons
7eb65db75c v0.70.x stable 2023-01-25 15:20:30 -05:00
Mikayla Maki
fa77450a72 v0.70.x preview 2023-01-18 12:39:21 -08:00
8 changed files with 25 additions and 22 deletions

2
Cargo.lock generated
View file

@ -8186,7 +8186,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
[[package]]
name = "zed"
version = "0.70.0"
version = "0.70.1"
dependencies = [
"activity_indicator",
"anyhow",

View file

@ -83,5 +83,3 @@ split-debuginfo = "unpacked"
[profile.release]
debug = true

View file

@ -5,6 +5,7 @@ WORKDIR app
COPY . .
# Compile collab server
ARG CARGO_PROFILE_RELEASE_PANIC=abort
RUN --mount=type=cache,target=./script/node_modules \
--mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=./target \

View file

@ -1586,12 +1586,8 @@ impl Database {
.filter(
Condition::all()
.add(
room_participant::Column::CallingConnectionId
.eq(connection.id as i32),
)
.add(
room_participant::Column::CallingConnectionServerId
.eq(connection.owner_id as i32),
room_participant::Column::CallingUserId
.eq(leaving_participant.user_id),
)
.add(room_participant::Column::AnsweringConnectionId.is_null()),
)

View file

@ -166,12 +166,10 @@ async fn test_random_collaboration(
let contacts = server.app_state.db.get_contacts(*user_id).await.unwrap();
let pool = server.connection_pool.lock();
for contact in contacts {
if let db::Contact::Accepted { user_id, .. } = contact {
if pool.is_user_online(user_id) {
assert_ne!(
user_id, removed_user_id,
"removed client is still a contact of another peer"
);
if let db::Contact::Accepted { user_id, busy, .. } = contact {
if user_id == removed_user_id {
assert!(!pool.is_user_online(user_id));
assert!(!busy);
}
}
}

View file

@ -9,7 +9,7 @@ use std::fmt;
use std::{
cmp,
fmt::Debug,
io, iter, mem,
io, iter,
time::{Duration, SystemTime, UNIX_EPOCH},
};
@ -489,16 +489,26 @@ pub fn split_worktree_update(
return None;
}
let chunk_size = cmp::min(message.updated_entries.len(), max_chunk_size);
let updated_entries = message.updated_entries.drain(..chunk_size).collect();
done = message.updated_entries.is_empty();
let updated_entries_chunk_size = cmp::min(message.updated_entries.len(), max_chunk_size);
let updated_entries = message
.updated_entries
.drain(..updated_entries_chunk_size)
.collect();
let removed_entries_chunk_size = cmp::min(message.removed_entries.len(), max_chunk_size);
let removed_entries = message
.removed_entries
.drain(..removed_entries_chunk_size)
.collect();
done = message.updated_entries.is_empty() && message.removed_entries.is_empty();
Some(UpdateWorktree {
project_id: message.project_id,
worktree_id: message.worktree_id,
root_name: message.root_name.clone(),
abs_path: message.abs_path.clone(),
updated_entries,
removed_entries: mem::take(&mut message.removed_entries),
removed_entries,
scan_id: message.scan_id,
is_last_update: done && message.is_last_update,
})

View file

@ -3,7 +3,7 @@ authors = ["Nathan Sobo <nathansobo@gmail.com>"]
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.70.0"
version = "0.70.1"
[lib]
name = "zed"

View file

@ -1 +1 @@
dev
stable