Excluded deleted entries when initially sending worktrees to guests

Max Brunsfeld and Antonio Scandurra created

Co-authored-by: Antonio Scandurra <antonio@zed.dev>

Change summary

crates/collab/src/db.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Detailed changes

crates/collab/src/db.rs 🔗

@@ -2390,7 +2390,11 @@ impl Database {
             // Populate worktree entries.
             {
                 let mut db_entries = worktree_entry::Entity::find()
-                    .filter(worktree_entry::Column::ProjectId.eq(project_id))
+                    .filter(
+                        Condition::all()
+                            .add(worktree_entry::Column::ProjectId.eq(project_id))
+                            .add(worktree_entry::Column::IsDeleted.eq(false)),
+                    )
                     .stream(&*tx)
                     .await?;
                 while let Some(db_entry) = db_entries.next().await {