zed-industries/zed · error

member request already in progress

Error message

member request already in progress

What it means

ChannelStore::set_member_role reuses the outgoing_invites set as a guard keyed by (channel_id, user_id); the error means a role change (or invite) for that member is already in flight, so the duplicate request is rejected locally before hitting the server.

Solutions

  1. Wait for the in-flight member request to settle before changing the role again
  2. Debounce or disable role-change UI for that member while a request is pending
  3. Ensure the guard entry is removed on completion/failure so subsequent requests can proceed
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/channel/src/channel_store.rs:702 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/361616f423e0c130. Report an issue: GitHub.

Appendix: source

Thrown at crates/channel/src/channel_store.rs:702

            this.update(cx, |this, cx| {
                this.outgoing_invites.remove(&(channel_id, user_id));
                cx.notify();
            })?;
            result?;
            Ok(())
        })
    }

    pub fn set_member_role(
        &mut self,
        channel_id: ChannelId,
        user_id: LegacyUserId,
        role: proto::ChannelRole,
        cx: &mut Context<Self>,
    ) -> Task<Result<()>> {
        if !self.outgoing_invites.insert((channel_id, user_id)) {
            return Task::ready(Err(anyhow!("member request already in progress")));
        }

        cx.notify();
        let client = self.client.clone();
        cx.spawn(async move |this, cx| {
            let result = client
                .request(proto::SetChannelMemberRole {
                    channel_id: channel_id.0,
                    user_id,
                    role: role.into(),
                })
                .await;

            this.update(cx, |this, cx| {
                this.outgoing_invites.remove(&(channel_id, user_id));
                cx.notify();
            })?;

View on GitHub (pinned to f4178619ac)