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

could not update room participant location

Error message

could not update room participant location

What it means

update_room_participant_location runs an UPDATE on the participant row matched by room, user, and answering connection; zero rows affected means the participant row was missing or the connection no longer matched, so the location update silently matched nothing and is reported as a failure.

Solutions

  1. Rejoin the room to re-establish the participant row
  2. Verify the connection ID still belongs to the participant (not reconnect-lost)
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/collab/src/db/queries/rooms.rs:1119 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/9df9530ed6c0e0e5. Report an issue: GitHub.

Appendix: source

Thrown at crates/collab/src/db/queries/rooms.rs:1119

                        )
                        .add(
                            room_participant::Column::AnsweringConnectionServerId
                                .eq(connection.owner_id as i32),
                        ),
                )
                .set(room_participant::ActiveModel {
                    location_kind: ActiveValue::set(Some(location_kind)),
                    location_project_id: ActiveValue::set(location_project_id),
                    ..Default::default()
                })
                .exec(&*tx)
                .await?;

            if result.rows_affected == 1 {
                let room = self.get_room(room_id, &tx).await?;
                Ok(room)
            } else {
                Err(anyhow!("could not update room participant location"))?
            }
        })
        .await
    }

    /// Sets the role of a participant in the given room.
    pub async fn set_room_participant_role(
        &self,
        admin_id: UserId,
        room_id: RoomId,
        user_id: UserId,
        role: ChannelRole,
    ) -> Result<TransactionGuard<proto::Room>> {
        self.room_transaction(room_id, |tx| async move {
            room_participant::Entity::find()
                .filter(
                    Condition::all()
                        .add(room_participant::Column::RoomId.eq(room_id))

View on GitHub (pinned to f4178619ac)