Compare commits

...

3 Commits

Author SHA1 Message Date
Joseph T Lyons
515f9a6c7d zed 0.157.1 2024-10-09 14:12:20 -04:00
Thorsten Ball
9c33d723f8 ssh session: Fix hang when doing state update in reconnect (#18934)
This snuck in last-minute.

Release Notes:

- Fixed a potential hang and panic when an SSH project goes through a
slow reconnect.
2024-10-09 14:07:43 -04:00
Joseph T Lyons
5b303e892a v0.157.x preview 2024-10-09 11:32:19 -04:00
4 changed files with 11 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -14396,7 +14396,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.157.0"
version = "0.157.1"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -563,6 +563,7 @@ impl SshRemoteClient {
return Ok(());
}
drop(lock);
self.set_state(State::Reconnecting, cx);
log::info!("Trying to reconnect to ssh server... Attempt {}", attempts);
@@ -734,6 +735,7 @@ impl SshRemoteClient {
} else {
state.heartbeat_recovered()
};
self.set_state(next_state, cx);
if missed_heartbeats >= MAX_MISSED_HEARTBEATS {
@@ -877,8 +879,12 @@ impl SshRemoteClient {
cx: &mut ModelContext<Self>,
map: impl FnOnce(&State) -> Option<State>,
) {
if let Some(new_state) = self.state.lock().as_ref().and_then(map) {
self.set_state(new_state, cx);
let mut lock = self.state.lock();
let new_state = lock.as_ref().and_then(map);
if let Some(new_state) = new_state {
lock.replace(new_state);
cx.notify();
}
}

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.157.0"
version = "0.157.1"
publish = false
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
preview