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

guests cannot share projects

Error message

guests cannot share projects

What it means

share_project checks the requesting participant's role; guests (roles below full member) are not permitted to share projects into the room. The participant's role in the target room is the input at fault.

Solutions

  1. Ask the room host or a full participant to share the project
  2. Upgrade the user's room role if guests should be allowed to share
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/collab/src/db/queries/projects.rs:63 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/ae416b2b37bc2f20. Report an issue: GitHub.

Appendix: source

Thrown at crates/collab/src/db/queries/projects.rs:63

                                .eq(connection.id as i32),
                        )
                        .add(
                            room_participant::Column::AnsweringConnectionServerId
                                .eq(connection.owner_id as i32),
                        ),
                )
                .one(&*tx)
                .await?
                .context("could not find participant")?;
            if participant.room_id != room_id {
                return Err(anyhow!("shared project on unexpected room"))?;
            }
            if !participant
                .role
                .unwrap_or(ChannelRole::Member)
                .can_edit_projects()
            {
                return Err(anyhow!("guests cannot share projects"))?;
            }

            let project = project::ActiveModel {
                room_id: ActiveValue::set(Some(participant.room_id)),
                host_user_id: ActiveValue::set(Some(participant.user_id)),
                host_connection_id: ActiveValue::set(Some(connection.id as i32)),
                host_connection_server_id: ActiveValue::set(Some(ServerId(
                    connection.owner_id as i32,
                ))),
                id: ActiveValue::NotSet,
                windows_paths: ActiveValue::set(windows_paths),
                features: ActiveValue::set(serde_json::to_string(features).unwrap()),
            }
            .insert(&*tx)
            .await?;

            if !worktrees.is_empty() {
                worktree::Entity::insert_many(worktrees.iter().map(|worktree| {

View on GitHub (pinned to f4178619ac)