{"record":{"id":"be63a705e54d3c96","repo":"zed-industries/zed","slug":"could-not-update-room-participant-role","errorCode":null,"errorMessage":"could not update room participant role","messagePattern":"could not update room participant role","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/rooms.rs","lineNumber":1164,"sourceCode":"                self.check_user_has_signed_cla(user_id, room_id, &tx)\n                    .await?;\n            }\n\n            let result = room_participant::Entity::update_many()\n                .filter(\n                    Condition::all()\n                        .add(room_participant::Column::RoomId.eq(room_id))\n                        .add(room_participant::Column::UserId.eq(user_id)),\n                )\n                .set(room_participant::ActiveModel {\n                    role: ActiveValue::set(Some(role)),\n                    ..Default::default()\n                })\n                .exec(&*tx)\n                .await?;\n\n            if result.rows_affected != 1 {\n                Err(anyhow!(\"could not update room participant role\"))?;\n            }\n            self.get_room(room_id, &tx).await\n        })\n        .await\n    }\n\n    async fn check_user_has_signed_cla(\n        &self,\n        user_id: UserId,\n        room_id: RoomId,\n        tx: &DatabaseTransaction,\n    ) -> Result<()> {\n        let channel = room::Entity::find_by_id(room_id)\n            .one(tx)\n            .await?\n            .context(\"could not find room\")?\n            .find_related(channel::Entity)\n            .one(tx)","sourceCodeStart":1146,"sourceCodeEnd":1182,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/rooms.rs#L1146-L1182","documentation":"set_room_participant_role updates the participant's role row; zero rows affected means no participant row matched (room, user), so the role change targeted a user who is not in the room and the transaction reports failure.","triggerScenarios":"Thrown at crates/collab/src/db/queries/rooms.rs:1164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the user is currently a participant in the room","Have the user join the room before changing their role"],"exampleFix":null,"handlingStrategy":"try-catch","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"}