{"record":{"id":"51cc093230c3db93","repo":"zed-industries/zed","slug":"not-a-collaborator-on-this-project","errorCode":null,"errorMessage":"not a collaborator on this project","messagePattern":"not a collaborator on this project","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/projects.rs","lineNumber":1025,"sourceCode":"        &self,\n        project_id: ProjectId,\n        connection: ConnectionId,\n    ) -> Result<TransactionGuard<(Option<proto::Room>, LeftProject)>> {\n        self.project_transaction(project_id, |tx| async move {\n            let result = project_collaborator::Entity::delete_many()\n                .filter(\n                    Condition::all()\n                        .add(project_collaborator::Column::ProjectId.eq(project_id))\n                        .add(project_collaborator::Column::ConnectionId.eq(connection.id as i32))\n                        .add(\n                            project_collaborator::Column::ConnectionServerId\n                                .eq(connection.owner_id as i32),\n                        ),\n                )\n                .exec(&*tx)\n                .await?;\n            if result.rows_affected == 0 {\n                Err(anyhow!(\"not a collaborator on this project\"))?;\n            }\n\n            let project = project::Entity::find_by_id(project_id)\n                .one(&*tx)\n                .await?\n                .context(\"no such project\")?;\n            let collaborators = project\n                .find_related(project_collaborator::Entity)\n                .all(&*tx)\n                .await?;\n            let connection_ids: Vec<ConnectionId> = collaborators\n                .into_iter()\n                .map(|collaborator| collaborator.connection())\n                .collect();\n\n            follower::Entity::delete_many()\n                .filter(\n                    Condition::any()","sourceCodeStart":1007,"sourceCodeEnd":1043,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/projects.rs#L1007-L1043","documentation":"leave_project deletes the project_collaborator row matching (project, connection); when zero rows are affected the connection was not a collaborator on the project, so there is nothing to leave. The project_id in the request is the input at fault.","triggerScenarios":"Thrown at crates/collab/src/db/queries/projects.rs:1025 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the connection is actually a collaborator on the named project","Treat as already-left and skip the operation if idempotency is acceptable"],"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"}