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

no such member

Error message

no such member

What it means

remove_channel_member deletes the channel_member row for (channel, member); if zero rows are deleted the user was not a member of that channel. The named member_id is the input at fault — it may have already left or been removed.

Solutions

  1. Verify the user is currently a member of the channel
  2. Refresh the member list; the user may have already been removed or left
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/collab/src/db/queries/channels.rs:490 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/5fd0485f5a456fa3. Report an issue: GitHub.

Appendix: source

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

        self.transaction(|tx| async move {
            let channel = self.get_channel_internal(channel_id, &tx).await?;

            if member_id != admin_id {
                self.check_user_is_channel_admin(&channel, admin_id, &tx)
                    .await?;
            }

            let result = channel_member::Entity::delete_many()
                .filter(
                    channel_member::Column::ChannelId
                        .eq(channel_id)
                        .and(channel_member::Column::UserId.eq(member_id)),
                )
                .exec(&*tx)
                .await?;

            if result.rows_affected == 0 {
                Err(anyhow!("no such member"))?;
            }

            Ok(RemoveChannelMemberResult {
                membership_update: self
                    .calculate_membership_updated(&channel, member_id, &tx)
                    .await?,
                notification_id: self
                    .remove_notification(
                        member_id,
                        rpc::Notification::ChannelInvitation {
                            channel_id: channel_id.to_proto(),
                            channel_name: Default::default(),
                            inviter_id: Default::default(),
                        },
                        &tx,
                    )
                    .await?,
            })

View on GitHub (pinned to f4178619ac)