{"record":{"id":"1a773222c95e61be","repo":"zed-industries/zed","slug":"can-t-delete-channel-while-a-call-is-in-progress","errorCode":null,"errorMessage":"can't delete channel while a call is in progress","messagePattern":"can't delete channel while a call is in progress","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/channels.rs","lineNumber":272,"sourceCode":"                .await?;\n\n            let channels_to_remove = self\n                .get_channel_descendants_excluding_self([&channel], &tx)\n                .await?\n                .into_iter()\n                .map(|channel| channel.id)\n                .chain(Some(channel_id))\n                .collect::<Vec<_>>();\n\n            let channel_has_active_participants = room_participant::Entity::find()\n                .inner_join(room::Entity)\n                .filter(room::Column::ChannelId.is_in(channels_to_remove.iter().copied()))\n                .count(&*tx)\n                .await?\n                > 0;\n\n            if channel_has_active_participants {\n                Err(anyhow!(\"can't delete channel while a call is in progress\"))?;\n            }\n\n            channel::Entity::delete_many()\n                .filter(channel::Column::Id.is_in(channels_to_remove.iter().copied()))\n                .exec(&*tx)\n                .await?;\n\n            Ok((channel.root_id(), channels_to_remove))\n        })\n        .await\n    }\n\n    /// Invites a user to a channel as a member.\n    pub async fn invite_channel_member(\n        &self,\n        channel_id: ChannelId,\n        invitee_id: UserId,\n        inviter_id: UserId,","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/channels.rs#L254-L290","documentation":"delete_channel counts active room participants across the channel and all its descendants before deleting; if any associated room still has participants (i.e. a call is live), the transaction is aborted with this error to prevent destroying an in-progress call.","triggerScenarios":"Thrown at crates/collab/src/db/queries/channels.rs:272 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait until the ongoing call in the channel (or a sub-channel) has ended","Have participants leave the call, then retry the deletion"],"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"}