From 26bdb60b8695aea9cb4fff33d174da1e580b3380 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:24:26 -0700 Subject: [PATCH] Fail better when workspace restoration all fails (#50330) (cherry-pick to preview) (#50334) Cherry-pick of #50330 to preview ---- Release Notes: - Fixed a bug that caused Zed to appear not to open if your workspaces failed to restore Co-authored-by: Conrad Irwin --- crates/zed/src/main.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 95ff6f03b1b7902e254c5e405c5d8b50e1f48773..7cf238e9dda22f1cd60056ffd3556cecdf3fb231 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -1393,7 +1393,7 @@ pub(crate) async fn restore_or_create_workspace( .update(cx, |multi_workspace, _, cx| { multi_workspace.workspace().update(cx, |workspace, cx| { workspace.show_toast( - Toast::new(NotificationId::unique::<()>(), message), + Toast::new(NotificationId::unique::<()>(), message.clone()), cx, ) }); @@ -1405,11 +1405,23 @@ pub(crate) async fn restore_or_create_workspace( }); // If we couldn't show a toast (no windows opened successfully), - // we've already logged the errors above, so the user can check logs + // open a fallback empty workspace and show the error there if !toast_shown { - log::error!( - "Failed to show notification for window restoration errors, because no workspace windows were available." - ); + log::error!("All workspace restorations failed. Opening fallback empty workspace."); + cx.update(|cx| { + workspace::open_new( + Default::default(), + app_state.clone(), + cx, + |workspace, _window, cx| { + workspace.show_toast( + Toast::new(NotificationId::unique::<()>(), message), + cx, + ); + }, + ) + }) + .await?; } } } else if matches!(KEY_VALUE_STORE.read_kvp(FIRST_OPEN), Ok(None)) {