{"record":{"id":"d75d208f6b6868b4","repo":"zed-industries/zed","slug":"can-t-update-a-project-hosted-by-someone-else","errorCode":null,"errorMessage":"can't update a project hosted by someone else","messagePattern":"can't update a project hosted by someone else","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/projects.rs","lineNumber":533,"sourceCode":"\n    /// Updates the diagnostic summary for the given connection.\n    pub async fn update_diagnostic_summary(\n        &self,\n        update: &proto::UpdateDiagnosticSummary,\n        connection: ConnectionId,\n    ) -> Result<TransactionGuard<Vec<ConnectionId>>> {\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            let summary = update.summary.as_ref().context(\"invalid summary\")?;\n\n            // Ensure the update comes from the host.\n            let project = project::Entity::find_by_id(project_id)\n                .one(&*tx)\n                .await?\n                .context(\"no such project\")?;\n            if project.host_connection()? != connection {\n                return Err(anyhow!(\"can't update a project hosted by someone else\"))?;\n            }\n\n            // Update summary.\n            worktree_diagnostic_summary::Entity::insert(worktree_diagnostic_summary::ActiveModel {\n                project_id: ActiveValue::set(project_id),\n                worktree_id: ActiveValue::set(worktree_id),\n                path: ActiveValue::set(summary.path.clone()),\n                language_server_id: ActiveValue::set(summary.language_server_id as i64),\n                error_count: ActiveValue::set(summary.error_count as i32),\n                warning_count: ActiveValue::set(summary.warning_count as i32),\n            })\n            .on_conflict(\n                OnConflict::columns([\n                    worktree_diagnostic_summary::Column::ProjectId,\n                    worktree_diagnostic_summary::Column::WorktreeId,\n                    worktree_diagnostic_summary::Column::Path,\n                ])\n                .update_columns([","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/projects.rs#L515-L551","documentation":"update_diagnostic_summary loads the project and asserts its host connection matches the sender, ensuring diagnostic updates come from the host. This error means the calling connection is not the host of the project it tried to update.","triggerScenarios":"Thrown at crates/collab/src/db/queries/projects.rs:533 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send diagnostic summaries only from the host connection of the project","Verify the project_id belongs to a project this connection hosts"],"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-23T08:17:48.524Z"}