Skip to content

Commit

Permalink
fix: newly created teams displayed as channels in sidebar with DISABL…
Browse files Browse the repository at this point in the history
…E_DB_WATCHERS enabled (#33908)
  • Loading branch information
ricardogarim authored and KevLehman committed Nov 11, 2024
1 parent f1fa49a commit c8bdb96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/light-terms-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes the issue where newly created teams are incorrectly displayed as channels on the sidebar when the DISABLE_DB_WATCHERS environment variable is enabled
4 changes: 3 additions & 1 deletion apps/meteor/server/services/team/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { addUserToRoom } from '../../../app/lib/server/functions/addUserToRoom';
import { checkUsernameAvailability } from '../../../app/lib/server/functions/checkUsernameAvailability';
import { getSubscribedRoomsForUserWithDetails } from '../../../app/lib/server/functions/getRoomsWithSingleOwner';
import { removeUserFromRoom } from '../../../app/lib/server/functions/removeUserFromRoom';
import { notifyOnSubscriptionChangedByRoomIdAndUserId } from '../../../app/lib/server/lib/notifyListener';
import { notifyOnSubscriptionChangedByRoomIdAndUserId, notifyOnRoomChangedById } from '../../../app/lib/server/lib/notifyListener';
import { settings } from '../../../app/settings/server';

export class TeamService extends ServiceClassInternal implements ITeamService {
Expand Down Expand Up @@ -131,6 +131,8 @@ export class TeamService extends ServiceClassInternal implements ITeamService {
await Message.saveSystemMessage('user-converted-to-team', roomId, team.name, createdBy);
}

void notifyOnRoomChangedById(roomId, 'inserted');

return {
_id: teamId,
...teamData,
Expand Down

0 comments on commit c8bdb96

Please sign in to comment.