# Preserve archived thread project paths after worktree removal \(\#53893\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bf0fcfbbac4ad7f042c424ccb66372ae844ac71d

Requested commit: bf0fcfbbac4ad7f042c424ccb66372ae844ac71d

Commit: bf0fcfbbac4ad7f042c424ccb66372ae844ac71d

Tree: c8e5c674bd465775efd90df887823f46d7b6c1ed

Author: Richard Feldman

Committer: GitHub

## Message

```
Preserve archived thread project paths after worktree removal (#53893)

When a thread created in a git worktree is archived, the archive flow
removes the linked worktree from the project. If a subsequent thread
event fires after this (e.g. an async title-generation task completing),
`handle_thread_event` recalculates `worktree_paths` from the project's
current state — which no longer includes the removed worktree — and
overwrites the archived thread's stored paths with empty ones.

This causes restoring the thread to prompt the user to re-associate a
project, instead of restoring it directly.

**Fix:** return early from `handle_thread_event` when the thread is
already archived, so the stored paths are never overwritten.

Release Notes:

- Fixed archived threads in git worktrees losing their project
association.
```

## Parents

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

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