From ffbbd8c40bb7a7cd7fe16cb41464a543adabc344 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 18 Jun 2024 10:11:23 -0300 Subject: [PATCH] regression: don't notify role changes during startup (#32619) --- .../server/lib/roles/createOrUpdateProtectedRole.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/meteor/server/lib/roles/createOrUpdateProtectedRole.ts b/apps/meteor/server/lib/roles/createOrUpdateProtectedRole.ts index cdc43cdad93a..ea59a2961ea4 100644 --- a/apps/meteor/server/lib/roles/createOrUpdateProtectedRole.ts +++ b/apps/meteor/server/lib/roles/createOrUpdateProtectedRole.ts @@ -1,8 +1,6 @@ import type { IRole, AtLeast } from '@rocket.chat/core-typings'; import { Roles } from '@rocket.chat/models'; -import { notifyOnRoleChanged, notifyOnRoleChangedById } from '../../../app/lib/server/lib/notifyListener'; - export const createOrUpdateProtectedRoleAsync = async ( roleId: string, roleData: AtLeast, 'name'>, @@ -12,7 +10,7 @@ export const createOrUpdateProtectedRoleAsync = async ( }); if (role) { - const updatedRole = await Roles.updateById( + await Roles.updateById( roleId, roleData.name || role.name, roleData.scope || role.scope, @@ -20,8 +18,6 @@ export const createOrUpdateProtectedRoleAsync = async ( roleData.mandatory2fa || role.mandatory2fa, ); - void notifyOnRoleChanged(updatedRole); - return; } @@ -33,6 +29,4 @@ export const createOrUpdateProtectedRoleAsync = async ( ...roleData, protected: true, }); - - void notifyOnRoleChangedById(roleId); };