Skip to content

Commit

Permalink
Merge pull request #25510 from RocketChat/release-4.7.1
Browse files Browse the repository at this point in the history
Release 4.7.1
  • Loading branch information
d-gubert committed May 13, 2022
2 parents 9a59ff4 + 0126e82 commit 21bc94d
Show file tree
Hide file tree
Showing 14 changed files with 365 additions and 253 deletions.
43 changes: 43 additions & 0 deletions .github/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -74398,6 +74398,49 @@
"5.0"
],
"pull_requests": []
},
"4.7.1": {
"node_version": "14.18.3",
"npm_version": "6.14.15",
"mongo_versions": [
"3.6",
"4.0",
"4.2",
"4.4",
"5.0"
],
"pull_requests": [
{
"pr": "25471",
"title": "[FIX] Spotlight results showing usernames instead of real names",
"userLogin": "pierre-lehnen-rc",
"milestone": "4.7.1",
"contributors": [
"pierre-lehnen-rc"
]
},
{
"pr": "25434",
"title": "[FIX] LDAP sync removing users from channels when multiple groups are mapped to it",
"userLogin": "pierre-lehnen-rc",
"milestone": "4.7.1",
"contributors": [
"pierre-lehnen-rc"
]
},
{
"pr": "25441",
"title": "[NEW] Use setting to determine if initial general channel is needed",
"userLogin": "felipe-menelau",
"description": "- Adds flag responsible for overwriting #general channel creation",
"milestone": "4.7.1",
"contributors": [
"felipe-menelau",
"sampaiodiego",
"web-flow"
]
}
]
}
}
}
495 changes: 261 additions & 234 deletions HISTORY.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/meteor/.docker/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.access.redhat.com/ubi8/nodejs-12

ENV RC_VERSION 4.7.0
ENV RC_VERSION 4.7.1

MAINTAINER buildmaster@rocket.chat

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.snapcraft/resources/prepareRocketChat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

curl -SLf "https://releases.rocket.chat/4.7.0/download/" -o rocket.chat.tgz
curl -SLf "https://releases.rocket.chat/4.7.1/download/" -o rocket.chat.tgz

tar xf rocket.chat.tgz --strip 1

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/.snapcraft/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 5. `snapcraft snap`

name: rocketchat-server
version: 4.7.0
version: 4.7.1
summary: Rocket.Chat server
description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/
confinement: strict
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/lib/server/startup/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ settingsRegistry.add('uniqueID', process.env.DEPLOYMENT_ID || Random.id(), {
public: true,
});

settingsRegistry.add('Initial_Channel_Created', false, {
type: 'boolean',
hidden: true,
});

// When you define a setting and want to add a description, you don't need to automatically define the i18nDescription
// if you add a node to the i18n.json with the same setting name but with `_Description` it will automatically work.

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/utils/rocketchat.info
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "4.7.0"
"version": "4.7.1"
}
6 changes: 3 additions & 3 deletions apps/meteor/client/sidebar/search/SearchList.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const SearchList = forwardRef(function SearchList({ onClose }, ref) {
const itemIndexRef = useRef(0);

const sidebarViewMode = useUserPreference('sidebarViewMode');
const showRealName = useSetting('UI_Use_Real_Name');
const useRealName = useSetting('UI_Use_Real_Name');

const sideBarItemTemplate = useTemplateByViewMode();
const avatarTemplate = useAvatarTemplate();
Expand All @@ -166,11 +166,11 @@ const SearchList = forwardRef(function SearchList({ onClose }, ref) {
t,
SideBarItemTemplate: sideBarItemTemplate,
avatarTemplate,
showRealName,
useRealName,
extended,
sidebarViewMode,
}),
[avatarTemplate, extended, items, showRealName, sideBarItemTemplate, sidebarViewMode, t],
[avatarTemplate, extended, items, useRealName, sideBarItemTemplate, sidebarViewMode, t],
);

const changeSelection = useMutableCallback((dir) => {
Expand Down
27 changes: 21 additions & 6 deletions apps/meteor/ee/server/lib/ldap/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ export class LDAPEEManager extends LDAPManager {

logger.debug('syncing user channels');
const ldapFields = Object.keys(fieldMap);
const channelsToAdd = new Set<string>();
const channelsToRemove = new Set<string>();

for await (const ldapField of ldapFields) {
if (!fieldMap[ldapField]) {
Expand All @@ -299,21 +301,34 @@ export class LDAPEEManager extends LDAPManager {
if (room.teamMain) {
logger.error(`Can't add user to channel ${channel} because it is a team.`);
} else {
addUserToRoom(room._id, user);
logger.debug(`Synced user channel ${room._id} from LDAP for ${username}`);
channelsToAdd.add(room._id);
}
} else if (syncUserChannelsRemove && !room.teamMain) {
const subscription = await SubscriptionsRaw.findOneByRoomIdAndUserId(room._id, user._id);
if (subscription) {
await removeUserFromRoom(room._id, user);
}
channelsToRemove.add(room._id);
}
} catch (e) {
logger.debug(`Failed to sync user room, user = ${username}, channel = ${channel}`);
logger.error(e);
}
}
}

for (const rid of channelsToAdd) {
addUserToRoom(rid, user);
logger.debug(`Synced user channel ${rid} from LDAP for ${username}`);
}

for await (const rid of channelsToRemove) {
if (channelsToAdd.has(rid)) {
return;
}

const subscription = await SubscriptionsRaw.findOneByRoomIdAndUserId(rid, user._id);
if (subscription) {
await removeUserFromRoom(rid, user);
logger.debug(`Removed user ${username} from channel ${rid}`);
}
}
}

private static async syncUserTeams(ldap: LDAPConnection, user: IUser, dn: string, isNewRecord: boolean): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rocket.chat/meteor",
"description": "The Ultimate Open Source WebChat Platform",
"version": "4.7.0",
"version": "4.7.1",
"private": true,
"author": {
"name": "Rocket.Chat",
Expand Down
13 changes: 9 additions & 4 deletions apps/meteor/server/startup/initialData.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ import { Settings } from '../../app/models/server/raw';
import { validateEmail } from '../../lib/emailValidator';

Meteor.startup(async function () {
if (settings.get('Show_Setup_Wizard') === 'pending' && !Rooms.findOneById('GENERAL')) {
Rooms.createWithIdTypeAndName('GENERAL', 'c', 'general', {
default: true,
});
if (!settings.get('Initial_Channel_Created')) {
const exists = Rooms.findOneById('GENERAL', { fields: { _id: 1 } });
if (!exists) {
Rooms.createWithIdTypeAndName('GENERAL', 'c', 'general', {
default: true,
});
}

Settings.updateValueById('Initial_Channel_Created', true);
}

if (!Users.findOneById('rocket.cat')) {
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/server/startup/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ import './v258';
import './v259';
import './v260';
import './v261';
import './v262';
import './xrun';
16 changes: 16 additions & 0 deletions apps/meteor/server/startup/migrations/v262.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { addMigration } from '../../lib/migrations';
import { Settings } from '../../../app/models/server/raw';

addMigration({
version: 262,
async up() {
// in case server is being updated, we check setup wizard status to determine if should still create the initial channel
const setupWizard = await Settings.getValueById('Show_Setup_Wizard');
if (setupWizard === 'pending') {
// if still pending for some reason, we need to create the initial channel, so keep the setting as false
return;
}
// if the setup wizard is not pending anymore, we assume initial channel was already created once
await Settings.updateValueById('Initial_Channel_Created', true);
},
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rocket.chat",
"version": "4.7.0",
"version": "4.7.1",
"description": "Rocket.Chat Monorepo",
"main": "index.js",
"private": true,
Expand Down

0 comments on commit 21bc94d

Please sign in to comment.