diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index 850a879c7a89..e1dbdf4224c8 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 4.5.1 +ENV RC_VERSION 4.5.2 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index 6fb618dfbcc9..2380269cdb76 100644 --- a/.github/history.json +++ b/.github/history.json @@ -71319,6 +71319,24 @@ "'5.0'" ], "pull_requests": [ + { + "pr": "24782", + "title": "Release 4.5.1", + "userLogin": "pierre-lehnen-rc", + "contributors": [ + "renatobecker", + "pierre-lehnen-rc", + "sampaiodiego", + "matheusbsilva137", + "amolghode1981", + "juliajforesti", + "tiagoevanp", + "KevLehman", + "MartinSchoeler", + "Aman-Maheshwari", + "cuonghuunguyen" + ] + }, { "pr": "24760", "title": "[FIX] Apple login script being loaded even when Apple Login is disabled.", @@ -71457,6 +71475,103 @@ ] } ] + }, + "4.5.2": { + "node_version": "14.18.3", + "npm_version": "6.14.15", + "apps_engine_version": "1.31.0", + "mongo_versions": [ + "'3.6'", + "'4.0'", + "'4.2'", + "'4.4'", + "'5.0'" + ], + "pull_requests": [ + { + "pr": "24812", + "title": "[FIX] Revert AutoComplete", + "userLogin": "juliajforesti", + "milestone": "4.5.2", + "contributors": [ + "juliajforesti", + "ggazzo" + ] + }, + { + "pr": "24809", + "title": "Regression: Fix ParentRoomWithEndpointData in loop", + "userLogin": "sampaiodiego", + "milestone": "4.5.2", + "contributors": [ + "sampaiodiego" + ] + }, + { + "pr": "24732", + "title": "[FIX] `PaginatedSelectFiltered` not handling changes", + "userLogin": "tassoevan", + "milestone": "4.5.2", + "contributors": [ + "tassoevan" + ] + }, + { + "pr": "24805", + "title": "[FIX] Critical: Incorrect visitor getting assigned to a chat from apps", + "userLogin": "murtaza98", + "milestone": "4.5.2", + "contributors": [ + "murtaza98" + ] + }, + { + "pr": "24804", + "title": "[FIX] \"livechat/webrtc.call\" endpoint not working", + "userLogin": "murtaza98", + "milestone": "4.5.2", + "contributors": [ + "murtaza98" + ] + }, + { + "pr": "24792", + "title": "[FIX] VoipExtensionsPage component call", + "userLogin": "KevLehman", + "milestone": "4.5.2", + "contributors": [ + "KevLehman" + ] + }, + { + "pr": "24705", + "title": "[FIX] Broken multiple OAuth integrations", + "userLogin": "debdutdeb", + "milestone": "4.5.2", + "contributors": [ + "debdutdeb" + ] + }, + { + "pr": "24623", + "title": "[FIX] Opening a new DM from user card", + "userLogin": "tassoevan", + "description": "A race condition on `useRoomIcon` -- delayed merge of rooms and subscriptions -- was causing a UI crash whenever someone tried to open a DM from the user card component.", + "milestone": "4.5.2", + "contributors": [ + "tassoevan" + ] + }, + { + "pr": "24750", + "title": "[IMPROVE] Voip Extensions disabled state", + "userLogin": "MartinSchoeler", + "milestone": "4.5.2", + "contributors": [ + "MartinSchoeler" + ] + } + ] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 15fa6f07861d..c30d21c60ee2 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/4.5.1/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/4.5.2/download/" -o rocket.chat.tgz tar xf rocket.chat.tgz --strip 1 diff --git a/.snapcraft/snap/snapcraft.yaml b/.snapcraft/snap/snapcraft.yaml index 92087b132cfc..5d1cc3b31d05 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 4.5.1 +version: 4.5.2 summary: Rocket.Chat server description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/ confinement: strict diff --git a/HISTORY.md b/HISTORY.md index 7de8158ee519..ce74d1516cac 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,58 @@ +# 4.5.2 +`2022-03-12 ยท 1 ๐Ÿš€ ยท 7 ๐Ÿ› ยท 1 ๐Ÿ” ยท 8 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `14.18.3` +- NPM: `6.14.15` +- MongoDB: `3.6, 4.0, 4.2, 4.4, 5.0` +- Apps-Engine: `1.31.0` + +### ๐Ÿš€ Improvements + + +- Voip Extensions disabled state ([#24750](https://github.com/RocketChat/Rocket.Chat/pull/24750)) + +### ๐Ÿ› Bug fixes + + +- "livechat/webrtc.call" endpoint not working ([#24804](https://github.com/RocketChat/Rocket.Chat/pull/24804)) + +- `PaginatedSelectFiltered` not handling changes ([#24732](https://github.com/RocketChat/Rocket.Chat/pull/24732)) + +- Broken multiple OAuth integrations ([#24705](https://github.com/RocketChat/Rocket.Chat/pull/24705)) + +- Critical: Incorrect visitor getting assigned to a chat from apps ([#24805](https://github.com/RocketChat/Rocket.Chat/pull/24805)) + +- Opening a new DM from user card ([#24623](https://github.com/RocketChat/Rocket.Chat/pull/24623)) + + A race condition on `useRoomIcon` -- delayed merge of rooms and subscriptions -- was causing a UI crash whenever someone tried to open a DM from the user card component. + +- Revert AutoComplete ([#24812](https://github.com/RocketChat/Rocket.Chat/pull/24812)) + +- VoipExtensionsPage component call ([#24792](https://github.com/RocketChat/Rocket.Chat/pull/24792)) + +
+๐Ÿ” Minor changes + + +- Regression: Fix ParentRoomWithEndpointData in loop ([#24809](https://github.com/RocketChat/Rocket.Chat/pull/24809)) + +
+ +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@KevLehman](https://github.com/KevLehman) +- [@MartinSchoeler](https://github.com/MartinSchoeler) +- [@debdutdeb](https://github.com/debdutdeb) +- [@ggazzo](https://github.com/ggazzo) +- [@juliajforesti](https://github.com/juliajforesti) +- [@murtaza98](https://github.com/murtaza98) +- [@sampaiodiego](https://github.com/sampaiodiego) +- [@tassoevan](https://github.com/tassoevan) + # 4.5.1 -`2022-03-09 ยท 13 ๐Ÿ› ยท 1 ๐Ÿ” ยท 11 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` +`2022-03-09 ยท 13 ๐Ÿ› ยท 2 ๐Ÿ” ยท 12 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` ### Engine versions - Node: `14.18.3` @@ -54,11 +106,14 @@ - Chore: Update Livechat ([#24754](https://github.com/RocketChat/Rocket.Chat/pull/24754)) +- Release 4.5.1 ([#24782](https://github.com/RocketChat/Rocket.Chat/pull/24782) by [@Aman-Maheshwari](https://github.com/Aman-Maheshwari) & [@cuonghuunguyen](https://github.com/cuonghuunguyen)) + ### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Contributors ๐Ÿ˜ - [@Aman-Maheshwari](https://github.com/Aman-Maheshwari) +- [@cuonghuunguyen](https://github.com/cuonghuunguyen) ### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ @@ -22366,4 +22421,4 @@ - [@graywolf336](https://github.com/graywolf336) - [@marceloschmidt](https://github.com/marceloschmidt) - [@rodrigok](https://github.com/rodrigok) -- [@sampaiodiego](https://github.com/sampaiodiego) \ No newline at end of file +- [@sampaiodiego](https://github.com/sampaiodiego) diff --git a/app/dolphin/lib/common.js b/app/dolphin/lib/common.js index ddaacc16b2a2..d9a901cedda0 100644 --- a/app/dolphin/lib/common.js +++ b/app/dolphin/lib/common.js @@ -30,7 +30,7 @@ function DolphinOnCreateUser(options, user) { if (Meteor.isServer) { Meteor.startup(() => - settings.get('Accounts_OAuth_Dolphin_URL', (key, value) => { + settings.watch('Accounts_OAuth_Dolphin_URL', (value) => { config.serverURL = value; return Dolphin.configure(config); }), diff --git a/app/drupal/lib/common.js b/app/drupal/lib/common.js index 4eea0cf99088..9090b3d75e2e 100644 --- a/app/drupal/lib/common.js +++ b/app/drupal/lib/common.js @@ -27,7 +27,7 @@ const Drupal = new CustomOAuth('drupal', config); if (Meteor.isServer) { Meteor.startup(function () { - settings.get('API_Drupal_URL', function (key, value) { + settings.watch('API_Drupal_URL', function (value) { config.serverURL = value; Drupal.configure(config); }); diff --git a/app/github-enterprise/lib/common.js b/app/github-enterprise/lib/common.js index 5cb6ef471cfe..b1b07abc6cb8 100644 --- a/app/github-enterprise/lib/common.js +++ b/app/github-enterprise/lib/common.js @@ -22,7 +22,7 @@ const GitHubEnterprise = new CustomOAuth('github_enterprise', config); if (Meteor.isServer) { Meteor.startup(function () { - settings.get('API_GitHub_Enterprise_URL', function (key, value) { + settings.watch('API_GitHub_Enterprise_URL', function (value) { config.serverURL = value; GitHubEnterprise.configure(config); }); diff --git a/app/gitlab/lib/common.js b/app/gitlab/lib/common.js index fd4520a7337d..5e3bd9941846 100644 --- a/app/gitlab/lib/common.js +++ b/app/gitlab/lib/common.js @@ -28,9 +28,7 @@ if (Meteor.isServer) { Gitlab.configure(config); }, 300); - settings.get('API_Gitlab_URL', updateConfig); - settings.get('Accounts_OAuth_Gitlab_identity_path', updateConfig); - settings.get('Accounts_OAuth_Gitlab_merge_users', updateConfig); + settings.watchMultiple(['API_Gitlab_URL', 'Accounts_OAuth_Gitlab_identity_path', 'Accounts_OAuth_Gitlab_merge_users'], updateConfig); }); } else { Meteor.startup(function () { diff --git a/app/livechat/server/api/lib/livechat.js b/app/livechat/server/api/lib/livechat.js index d95cf802420b..d324da67fe37 100644 --- a/app/livechat/server/api/lib/livechat.js +++ b/app/livechat/server/api/lib/livechat.js @@ -107,7 +107,7 @@ export function normalizeHttpHeaderData(headers = {}) { const httpHeaders = Object.assign({}, headers); return { httpHeaders }; } -export async function settings({ businessUnit = '' }) { +export async function settings({ businessUnit = '' } = {}) { const initSettings = Livechat.getInitSettings(); const triggers = await findTriggers(); const departments = findDepartments(businessUnit); diff --git a/app/livechat/server/api/v1/videoCall.js b/app/livechat/server/api/v1/videoCall.js index 484eb30a0ba6..8f8f74c078e5 100644 --- a/app/livechat/server/api/v1/videoCall.js +++ b/app/livechat/server/api/v1/videoCall.js @@ -10,6 +10,9 @@ import { findGuest, getRoom, settings } from '../lib/livechat'; import { OmnichannelSourceType } from '../../../../../definition/IRoom'; import { hasPermission, canSendMessage } from '../../../../authorization'; import { Livechat } from '../../lib/Livechat'; +import { Logger } from '../../../../logger'; + +const logger = new Logger('LivechatVideoCallApi'); API.v1.addRoute('livechat/video.call/:token', { get() { @@ -62,6 +65,7 @@ API.v1.addRoute('livechat/video.call/:token', { return API.v1.success(this.deprecationWarning({ videoCall })); } catch (e) { + logger.error(e); return API.v1.failure(e); } }, @@ -124,6 +128,7 @@ API.v1.addRoute( }; return API.v1.success({ videoCall }); } catch (e) { + logger.error(e); return API.v1.failure(e); } }, @@ -170,6 +175,7 @@ API.v1.addRoute( return API.v1.success({ status }); } catch (e) { + logger.error(e); return API.v1.failure(e); } }, diff --git a/app/livechat/server/lib/Livechat.js b/app/livechat/server/lib/Livechat.js index 7a894a383d10..4ecc61e964ec 100644 --- a/app/livechat/server/lib/Livechat.js +++ b/app/livechat/server/lib/Livechat.js @@ -318,7 +318,7 @@ export const Livechat = { if (user) { Livechat.logger.debug('Found matching user by token'); userId = user._id; - } else if (phone && (existingUser = LivechatVisitors.findOneVisitorByPhone(phone.number))) { + } else if (phone?.number && (existingUser = LivechatVisitors.findOneVisitorByPhone(phone.number))) { Livechat.logger.debug('Found matching user by phone number'); userId = existingUser._id; // Don't change token when matching by phone number, use current visitor token diff --git a/app/tokenpass/lib/common.js b/app/tokenpass/lib/common.js index 525aa88fcad5..0cd6868a3672 100644 --- a/app/tokenpass/lib/common.js +++ b/app/tokenpass/lib/common.js @@ -24,7 +24,7 @@ const Tokenpass = new CustomOAuth('tokenpass', config); if (Meteor.isServer) { Meteor.startup(function () { - settings.get('API_Tokenpass_URL', function (key, value) { + settings.watch('API_Tokenpass_URL', function (value) { config.serverURL = value; Tokenpass.configure(config); }); diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index a14d9200f10d..49de4d160a25 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "4.5.1" + "version": "4.5.2" } diff --git a/client/components/CreateDiscussion/CreateDiscussion.tsx b/client/components/CreateDiscussion/CreateDiscussion.tsx index 5fe9e6c12f9a..b5f2a67ab9be 100644 --- a/client/components/CreateDiscussion/CreateDiscussion.tsx +++ b/client/components/CreateDiscussion/CreateDiscussion.tsx @@ -65,8 +65,14 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug } }); - const onChangeUsers = useMutableCallback((value: CreateDiscussionFormValues['usernames']) => { - handleUsernames(value); + const onChangeUsers = useMutableCallback((value, action) => { + if (!action) { + if (usernames.includes(value)) { + return; + } + return handleUsernames([...usernames, value]); + } + handleUsernames(usernames.filter((current) => current !== value)); }); return ( diff --git a/client/components/UserAutoComplete/UserAutoComplete.js b/client/components/UserAutoComplete/UserAutoComplete.js index d2c3c507b3b3..9653710b5df0 100644 --- a/client/components/UserAutoComplete/UserAutoComplete.js +++ b/client/components/UserAutoComplete/UserAutoComplete.js @@ -1,4 +1,4 @@ -import { SelectFiltered, Option, Box, Chip } from '@rocket.chat/fuselage'; +import { AutoComplete, Option, Box, Chip, Avatar } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import React, { memo, useMemo, useState } from 'react'; @@ -17,29 +17,29 @@ const UserAutoComplete = (props) => { useMemo(() => query(debouncedFilter, conditions), [filter]), ); - const options = useMemo(() => (data && data.items.map((user) => [user.username, user.name])) || [], [data]); - - const renderSelected = ({ value, label }) => - value ? ( - props.onChange()} mie='x4'> - - - {label} - - - ) : null; - - const renderItem = ({ value, ...props }) =>