# Re-send worktree if reconnecting while initial scan isn't finished yet · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/5eb1719ab8e9a05b2190d82afaaeb9eff5ab2d4b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 5eb1719ab8e9a05b2190d82afaaeb9eff5ab2d4b

Requested commit: 5eb1719ab8e9a05b2190d82afaaeb9eff5ab2d4b

Commit: 5eb1719ab8e9a05b2190d82afaaeb9eff5ab2d4b

Tree: 854f13d0378944768fcdeae7856dae12a2791afa

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
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.

```

## Parents

- [172441ab7299f9d248809d0562b0ab8723ba9f0c](https://git.cafe/gitcafe/zed/commit/172441ab7299f9d248809d0562b0ab8723ba9f0c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/5eb1719ab8e9a05b2190d82afaaeb9eff5ab2d4b?format=markdown)
