{"record":{"id":"f8d3b2a60aa04f62","repo":"zed-industries/zed","slug":"room-does-not-exist-or-was-already-joined","errorCode":null,"errorMessage":"room does not exist or was already joined","messagePattern":"room does not exist or was already joined","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/rooms.rs","lineNumber":342,"sourceCode":"                .filter(\n                    Condition::all()\n                        .add(room_participant::Column::RoomId.eq(room_id))\n                        .add(room_participant::Column::UserId.eq(user_id))\n                        .add(room_participant::Column::AnsweringConnectionId.is_null()),\n                )\n                .set(room_participant::ActiveModel {\n                    participant_index: ActiveValue::Set(Some(participant_index)),\n                    answering_connection_id: ActiveValue::set(Some(connection.id as i32)),\n                    answering_connection_server_id: ActiveValue::set(Some(ServerId(\n                        connection.owner_id as i32,\n                    ))),\n                    answering_connection_lost: ActiveValue::set(false),\n                    ..Default::default()\n                })\n                .exec(&*tx)\n                .await?;\n            if result.rows_affected == 0 {\n                Err(anyhow!(\"room does not exist or was already joined\"))?;\n            }\n\n            let room = self.get_room(room_id, &tx).await?;\n            Ok(JoinRoom {\n                room,\n                channel: None,\n            })\n        })\n        .await\n    }\n\n    pub async fn stale_room_connection(&self, user_id: UserId) -> Result<Option<ConnectionId>> {\n        self.transaction(|tx| async move {\n            let participant = room_participant::Entity::find()\n                .filter(room_participant::Column::UserId.eq(user_id))\n                .one(&*tx)\n                .await?;\n            Ok(participant.and_then(|p| p.answering_connection()))","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/rooms.rs#L324-L360","documentation":"join_room updates the caller's participant row (matched by room, user, and null answering connection) to attach the new connection; zero rows affected means either the room/participant row does not exist or the user already has an active connection in the room.","triggerScenarios":"Thrown at crates/collab/src/db/queries/rooms.rs:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the room ID is correct and the user has been added to it","Leave the existing session first if already joined from this connection"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}