{"record":{"id":"9e135fa9aebf589c","repo":"zed-industries/zed","slug":"banned-users-cannot-invite","errorCode":null,"errorMessage":"banned users cannot invite","messagePattern":"banned users cannot invite","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/rooms.rs","lineNumber":169,"sourceCode":"        calling_connection: ConnectionId,\n        called_user_id: UserId,\n        initial_project_id: Option<ProjectId>,\n    ) -> Result<TransactionGuard<(proto::Room, proto::IncomingCall)>> {\n        self.room_transaction(room_id, |tx| async move {\n            let caller = room_participant::Entity::find()\n                .filter(\n                    room_participant::Column::UserId\n                        .eq(calling_user_id)\n                        .and(room_participant::Column::RoomId.eq(room_id)),\n                )\n                .one(&*tx)\n                .await?\n                .context(\"user is not in the room\")?;\n\n            let called_user_role = match caller.role.unwrap_or(ChannelRole::Member) {\n                ChannelRole::Admin | ChannelRole::Member => ChannelRole::Member,\n                ChannelRole::Guest | ChannelRole::Talker => ChannelRole::Guest,\n                ChannelRole::Banned => return Err(anyhow!(\"banned users cannot invite\").into()),\n            };\n\n            room_participant::ActiveModel {\n                room_id: ActiveValue::set(room_id),\n                user_id: ActiveValue::set(called_user_id),\n                answering_connection_lost: ActiveValue::set(false),\n                participant_index: ActiveValue::NotSet,\n                calling_user_id: ActiveValue::set(calling_user_id),\n                calling_connection_id: ActiveValue::set(calling_connection.id as i32),\n                calling_connection_server_id: ActiveValue::set(Some(ServerId(\n                    calling_connection.owner_id as i32,\n                ))),\n                initial_project_id: ActiveValue::set(initial_project_id),\n                role: ActiveValue::set(Some(called_user_role)),\n\n                id: ActiveValue::NotSet,\n                answering_connection_id: ActiveValue::NotSet,\n                answering_connection_server_id: ActiveValue::NotSet,","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/rooms.rs#L151-L187","documentation":"In the call flow, the calling user's room participant row is looked up and its role checked; banned participants cannot place calls to other users, so this sentinel aborts the call request at the authorization step.","triggerScenarios":"Thrown at crates/collab/src/db/queries/rooms.rs:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Have the user's ban lifted in the room or channel","Place the call from a non-banned account or room"],"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"}