{"record":{"id":"f8ba43f495d81430","repo":"zed-industries/zed","slug":"invalid-worktree-update-removed-entries-upda","errorCode":null,"errorMessage":"invalid worktree update. removed entries: {}, updated entries: {}","messagePattern":"invalid worktree update\\. removed entries: (.+?), updated entries: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/projects.rs","lineNumber":236,"sourceCode":"        worktree::Entity::delete_many()\n            .filter(worktree::Column::ProjectId.eq(project_id).and(\n                worktree::Column::Id.is_not_in(worktrees.iter().map(|worktree| worktree.id as i64)),\n            ))\n            .exec(tx)\n            .await?;\n\n        Ok(())\n    }\n\n    pub async fn update_worktree(\n        &self,\n        update: &proto::UpdateWorktree,\n        connection: ConnectionId,\n    ) -> Result<TransactionGuard<Vec<ConnectionId>>> {\n        if update.removed_entries.len() > proto::MAX_WORKTREE_UPDATE_MAX_CHUNK_SIZE\n            || update.updated_entries.len() > proto::MAX_WORKTREE_UPDATE_MAX_CHUNK_SIZE\n        {\n            return Err(anyhow!(\n                \"invalid worktree update. removed entries: {}, updated entries: {}\",\n                update.removed_entries.len(),\n                update.updated_entries.len()\n            ))?;\n        }\n\n        let project_id = ProjectId::from_proto(update.project_id);\n        let worktree_id = update.worktree_id as i64;\n        self.project_transaction(project_id, |tx| async move {\n            // Ensure the update comes from the host.\n            let _project = project::Entity::find_by_id(project_id)\n                .filter(\n                    Condition::all()\n                        .add(project::Column::HostConnectionId.eq(connection.id as i32))\n                        .add(\n                            project::Column::HostConnectionServerId.eq(connection.owner_id as i32),\n                        ),\n                )","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/projects.rs#L218-L254","documentation":"update_worktree rejects proto::UpdateWorktree payloads whose removed_entries or updated_entries exceed proto::MAX_WORKTREE_UPDATE_MAX_CHUNK_SIZE. It is a protocol-level chunk-size guard; the counts in the message show which side of the update was oversized.","triggerScenarios":"Thrown at crates/collab/src/db/queries/projects.rs:236 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Split the worktree update into smaller chunks within the protocol limit","Update both peers to versions agreeing on the chunk size limit"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}