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

can only send project updates to a project you're in

Error message

can only send project updates to a project you're in

What it means

internal_project_connection_ids collects the host and collaborator connections for a project and asserts the requesting connection is among them; this sentinel fires when a connection asks for the participant list of a project it never joined.

Source

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

        let mut connection_ids = HashSet::default();
        if let Some(host_connection) = project.host_connection().log_err()
            && !exclude_dev_server
        {
            connection_ids.insert(host_connection);
        }

        while let Some(collaborator) = collaborators.next().await {
            let collaborator = collaborator?;
            connection_ids.insert(collaborator.connection());
        }

        if connection_ids.contains(&connection_id)
            || Some(connection_id) == project.host_connection().ok()
        {
            Ok(connection_ids)
        } else {
            Err(anyhow!(
                "can only send project updates to a project you're in"
            ))?
        }
    }

    async fn project_guest_connection_ids(
        &self,
        project_id: ProjectId,
        tx: &DatabaseTransaction,
    ) -> Result<Vec<ConnectionId>> {
        let mut collaborators = project_collaborator::Entity::find()
            .filter(
                project_collaborator::Column::ProjectId
                    .eq(project_id)
                    .and(project_collaborator::Column::IsHost.eq(false)),
            )
            .stream(tx)
            .await?;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Join the project before requesting its connection IDs
  2. Verify the project_id is one the connection collaborates on
Defensive patterns

Strategy: validation

When it happens

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