From 5eb1719ab8e9a05b2190d82afaaeb9eff5ab2d4b Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 11 Apr 2023 17:15:43 +0200 Subject: [PATCH] Re-send worktree if reconnecting while initial scan isn't finished yet Previously, if the client was disconnected while the initial worktree state was being sent, it would not see the remaining state after reconnecting. This was due to `scan_id` and `completed_scan_id` both being initialized to `0`, so the client would ask for updates since `0` and get nothing. This commit changes the worktree to initialize `scan_id` to `1` and `completed_scan_id` to `0`, so that we get the full worktree again on reconnect. --- crates/project/src/worktree.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rs index 792e09a00a29b637fee8dda3bf92c0673e189000..0f31303635f1e70b978861bb796a76503e4b9f1f 100644 --- a/crates/project/src/worktree.rs +++ b/crates/project/src/worktree.rs @@ -221,7 +221,7 @@ impl Worktree { root_char_bag: root_name.chars().map(|c| c.to_ascii_lowercase()).collect(), entries_by_path: Default::default(), entries_by_id: Default::default(), - scan_id: 0, + scan_id: 1, completed_scan_id: 0, }, }; @@ -298,7 +298,7 @@ impl Worktree { .collect(), entries_by_path: Default::default(), entries_by_id: Default::default(), - scan_id: 0, + scan_id: 1, completed_scan_id: 0, };