zed-industries/zed · error · anyhow::Error

can't delete channel while a call is in progress

Error message

can't delete channel while a call is in progress

What it means

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.

Solutions

  1. Wait until the ongoing call in the channel (or a sub-channel) has ended
  2. Have participants leave the call, then retry the deletion
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/collab/src/db/queries/channels.rs:272 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/1a773222c95e61be. Report an issue: GitHub.

Appendix: source

Thrown at crates/collab/src/db/queries/channels.rs:272

                .await?;

            let channels_to_remove = self
                .get_channel_descendants_excluding_self([&channel], &tx)
                .await?
                .into_iter()
                .map(|channel| channel.id)
                .chain(Some(channel_id))
                .collect::<Vec<_>>();

            let channel_has_active_participants = room_participant::Entity::find()
                .inner_join(room::Entity)
                .filter(room::Column::ChannelId.is_in(channels_to_remove.iter().copied()))
                .count(&*tx)
                .await?
                > 0;

            if channel_has_active_participants {
                Err(anyhow!("can't delete channel while a call is in progress"))?;
            }

            channel::Entity::delete_many()
                .filter(channel::Column::Id.is_in(channels_to_remove.iter().copied()))
                .exec(&*tx)
                .await?;

            Ok((channel.root_id(), channels_to_remove))
        })
        .await
    }

    /// Invites a user to a channel as a member.
    pub async fn invite_channel_member(
        &self,
        channel_id: ChannelId,
        invitee_id: UserId,
        inviter_id: UserId,

View on GitHub (pinned to f4178619ac)