fix(spaces): remove is_enabled_for_space guard from ensure_default_roles
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5s
Update flake hashes / update-flake-hashes (pull_request) Failing after 5s
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 4s

The guard prevented ensure_default_roles from working in the enable
command — it checked the cascading state event which hasn't been
written yet at that point. Callers should gate this themselves.
This commit is contained in:
ember33 2026-03-19 19:55:44 +01:00
parent 5787f38906
commit 4df2fe2923

View file

@ -208,10 +208,6 @@ pub async fn is_enabled_for_space(&self, space_id: &RoomId) -> bool {
#[implement(Service)] #[implement(Service)]
pub async fn ensure_default_roles(&self, space_id: &RoomId) -> Result { pub async fn ensure_default_roles(&self, space_id: &RoomId) -> Result {
if !self.is_enabled_for_space(space_id).await {
return Ok(());
}
let server_user = self.services.globals.server_user.as_ref(); let server_user = self.services.globals.server_user.as_ref();
let state_lock = self.services.state.mutex.lock(space_id).await; let state_lock = self.services.state.mutex.lock(space_id).await;