From e48393575a0e41eacb5e23f08401f4224c2bd9bd Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Sun, 6 Jun 2021 18:47:13 -0300 Subject: [PATCH 1/9] [FIX] Support DISABLE_PRESENCE_MONITOR env var in new DB watchers (#22257) --- server/modules/watchers/watchers.module.ts | 35 ++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/server/modules/watchers/watchers.module.ts b/server/modules/watchers/watchers.module.ts index a6f856a4413..61a21e1f7d4 100644 --- a/server/modules/watchers/watchers.module.ts +++ b/server/modules/watchers/watchers.module.ts @@ -66,6 +66,9 @@ type Watcher = (model: IBaseRaw, fn: (event: IChange) type BroadcastCallback = (event: T, ...args: Parameters) => Promise; +const startMonitor = typeof process.env.DISABLE_PRESENCE_MONITOR === 'undefined' + || !['true', 'yes'].includes(String(process.env.DISABLE_PRESENCE_MONITOR).toLowerCase()); + export function initWatchers(models: IModelsParam, broadcast: BroadcastCallback, watch: Watcher): void { const { Messages, @@ -164,22 +167,24 @@ export function initWatchers(models: IModelsParam, broadcast: BroadcastCallback, }); }); - watch(UsersSessions, async ({ clientAction, id, data }) => { - switch (clientAction) { - case 'inserted': - case 'updated': - data = data ?? await UsersSessions.findOneById(id); - if (!data) { - return; - } + if (startMonitor) { + watch(UsersSessions, async ({ clientAction, id, data }) => { + switch (clientAction) { + case 'inserted': + case 'updated': + data = data ?? await UsersSessions.findOneById(id); + if (!data) { + return; + } - broadcast('watch.userSessions', { clientAction, userSession: data }); - break; - case 'removed': - broadcast('watch.userSessions', { clientAction, userSession: { _id: id } }); - break; - } - }); + broadcast('watch.userSessions', { clientAction, userSession: data }); + break; + case 'removed': + broadcast('watch.userSessions', { clientAction, userSession: { _id: id } }); + break; + } + }); + } watch(LivechatInquiry, async ({ clientAction, id, data, diff }) => { switch (clientAction) { From 958cc35658440bb9fa55a7cf65c4f59b240926fb Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Sun, 20 Jun 2021 03:44:09 -0300 Subject: [PATCH 2/9] [FIX] Setup wizard infinite loop when on subfolder (#22395) Co-authored-by: Tasso Evangelista --- client/startup/routes.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/startup/routes.ts b/client/startup/routes.ts index d2bf3c9372d..cd29aaeb8ab 100644 --- a/client/startup/routes.ts +++ b/client/startup/routes.ts @@ -11,6 +11,10 @@ import { IUser } from '../../definition/IUser'; import { appLayout } from '../lib/appLayout'; import { createTemplateForComponent } from '../lib/portals/createTemplateForComponent'; +const SetupWizardRoute = lazy(() => import('../views/setupWizard/SetupWizardRoute')); +const MailerUnsubscriptionPage = lazy(() => import('../views/mailer/MailerUnsubscriptionPage')); +const NotFoundPage = lazy(() => import('../views/notFound/NotFoundPage')); + FlowRouter.wait(); FlowRouter.route('/', { @@ -161,7 +165,6 @@ FlowRouter.route('/invite/:hash', { FlowRouter.route('/setup-wizard/:step?', { name: 'setup-wizard', action: () => { - const SetupWizardRoute = lazy(() => import('../views/setupWizard/SetupWizardRoute')); appLayout.render({ component: SetupWizardRoute }); }, }); @@ -169,14 +172,12 @@ FlowRouter.route('/setup-wizard/:step?', { FlowRouter.route('/mailer/unsubscribe/:_id/:createdAt', { name: 'mailer-unsubscribe', action: () => { - const MailerUnsubscriptionPage = lazy(() => import('../views/mailer/MailerUnsubscriptionPage')); appLayout.render({ component: MailerUnsubscriptionPage }); }, }); FlowRouter.notFound = { action: (): void => { - const NotFoundPage = lazy(() => import('../views/notFound/NotFoundPage')); appLayout.render({ component: NotFoundPage }); }, }; From 8e9dc8cc5cc48b46fa7845ea993f0362953eaddb Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Fri, 11 Jun 2021 15:09:18 -0300 Subject: [PATCH 3/9] [FIX] Attachments not rendered if deployed on subfolder (#22290) Co-authored-by: Tasso Evangelista --- app/utils/lib/getURL.js | 2 +- .../components/Message/Attachments/Files/ImageAttachment.tsx | 2 +- client/providers/AvatarUrlProvider.tsx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/utils/lib/getURL.js b/app/utils/lib/getURL.js index 4042d57414a..9e93b614abd 100644 --- a/app/utils/lib/getURL.js +++ b/app/utils/lib/getURL.js @@ -54,7 +54,7 @@ export const _getURL = (path, { cdn, full, cloud, cloud_route, cloud_params, _cd } if (full) { - return siteUrl + url; + return s.rtrim(siteUrl, pathPrefix) + url; } return url; diff --git a/client/components/Message/Attachments/Files/ImageAttachment.tsx b/client/components/Message/Attachments/Files/ImageAttachment.tsx index b81d49005e6..3c2b1d4b11d 100644 --- a/client/components/Message/Attachments/Files/ImageAttachment.tsx +++ b/client/components/Message/Attachments/Files/ImageAttachment.tsx @@ -51,7 +51,7 @@ export const ImageAttachment: FC = ({ {...imageDimensions} loadImage={loadImage} setLoadImage={setLoadImage} - src={url} + src={getURL(url)} previewUrl={`data:image/png;base64,${imagePreview}`} /> diff --git a/client/providers/AvatarUrlProvider.tsx b/client/providers/AvatarUrlProvider.tsx index 95d66e17704..3e69067df7c 100644 --- a/client/providers/AvatarUrlProvider.tsx +++ b/client/providers/AvatarUrlProvider.tsx @@ -1,6 +1,7 @@ import React, { useMemo, FC } from 'react'; import { roomTypes } from '../../app/utils/client'; +import { getURL } from '../../app/utils/lib/getURL'; import { AvatarUrlContext } from '../contexts/AvatarUrlContext'; import { useSetting } from '../contexts/SettingsContext'; @@ -19,7 +20,7 @@ const AvatarUrlProvider: FC = ({ children }) => { `${cdnAvatarUrl}/avatar/${uid}${etag ? `?etag=${etag}` : ''}`; } return (uid: string, etag?: string): string => - `/avatar/${uid}${etag ? `?etag=${etag}` : ''}`; + getURL(`/avatar/${uid}${etag ? `?etag=${etag}` : ''}`); })(), getRoomPathAvatar: ({ type, ...room }: any): string => roomTypes.getConfig(type || room.t).getAvatarPath({ username: room._id, ...room }), From ec2fd944fab3ff97bf6b1e8c9c83d69bd5081c2d Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 21 Jun 2021 09:52:06 -0300 Subject: [PATCH 4/9] Bump version to 3.15.1 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 76 ++++++++++++++++++++++++++ .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- HISTORY.md | 49 +++++++++++++++++ app/utils/rocketchat.info | 2 +- package-lock.json | 2 +- package.json | 2 +- 8 files changed, 131 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index 31cb2fd20b7..b74c9314e53 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 3.15.0 +ENV RC_VERSION 3.15.1 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index c58a362aef7..9f6c905ffff 100644 --- a/.github/history.json +++ b/.github/history.json @@ -61066,6 +61066,82 @@ "4.2" ], "pull_requests": [] + }, + "3.14.5": { + "node_version": "12.22.1", + "npm_version": "6.14.1", + "apps_engine_version": "1.25.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [ + { + "pr": "22258", + "title": "[IMPROVE] Send only relevant data via WebSocket", + "userLogin": "sampaiodiego", + "description": "Previously when any data changed on subscriptions or rooms we were getting fresh data from database, to also remove undesired fields, but sometimes the data that changed was not relevant so we were sending the whole object everytime **without** the fields that actually changed. This change aims to reduce this overhead and also send less data to clients.", + "milestone": "3.14.5", + "contributors": [ + "sampaiodiego", + "web-flow" + ] + }, + { + "pr": "22257", + "title": "[FIX] Support DISABLE_PRESENCE_MONITOR env var in new DB watchers", + "userLogin": "sampaiodiego", + "milestone": "3.14.5", + "contributors": [ + "sampaiodiego" + ] + } + ] + }, + "3.15.1": { + "node_version": "12.22.1", + "npm_version": "6.14.1", + "apps_engine_version": "1.26.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0", + "4.2" + ], + "pull_requests": [ + { + "pr": "22290", + "title": "[FIX] Attachments and avatars not rendered if deployed on subfolder", + "userLogin": "gabriellsh", + "milestone": "3.15.1", + "contributors": [ + "gabriellsh", + "tassoevan", + "web-flow" + ] + }, + { + "pr": "22395", + "title": "[FIX] Setup wizard infinite loop when on subfolder.", + "userLogin": "gabriellsh", + "milestone": "3.15.1", + "contributors": [ + "gabriellsh", + "tassoevan", + "web-flow" + ] + }, + { + "pr": "22257", + "title": "[FIX] Support DISABLE_PRESENCE_MONITOR env var in new DB watchers", + "userLogin": "sampaiodiego", + "milestone": "3.14.5", + "contributors": [ + "sampaiodiego" + ] + } + ] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index cc09b0cb490..7fafc6b7147 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/3.15.0/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/3.15.1/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 c3c6ff78a11..2a93a393f8a 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 3.15.0 +version: 3.15.1 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 de8922c4024..7bc8cd8c02e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,28 @@ +# 3.15.1 +`2021-06-21 ยท 3 ๐Ÿ› ยท 3 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.22.1` +- NPM: `6.14.1` +- MongoDB: `3.4, 3.6, 4.0, 4.2` +- Apps-Engine: `1.26.0` + +### ๐Ÿ› Bug fixes + + +- Attachments and avatars not rendered if deployed on subfolder ([#22290](https://github.com/RocketChat/Rocket.Chat/pull/22290)) + +- Setup wizard infinite loop when on subfolder. ([#22395](https://github.com/RocketChat/Rocket.Chat/pull/22395)) + +- Support DISABLE_PRESENCE_MONITOR env var in new DB watchers ([#22257](https://github.com/RocketChat/Rocket.Chat/pull/22257)) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@gabriellsh](https://github.com/gabriellsh) +- [@sampaiodiego](https://github.com/sampaiodiego) +- [@tassoevan](https://github.com/tassoevan) + # 3.15.0 `2021-05-28 ยท 8 ๐ŸŽ‰ ยท 12 ๐Ÿš€ ยท 62 ๐Ÿ› ยท 47 ๐Ÿ” ยท 34 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` @@ -605,6 +629,31 @@ - [@thassiov](https://github.com/thassiov) - [@tiagoevanp](https://github.com/tiagoevanp) +# 3.14.5 +`2021-06-06 ยท 1 ๐Ÿš€ ยท 1 ๐Ÿ› ยท 1 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.22.1` +- NPM: `6.14.1` +- MongoDB: `3.4, 3.6, 4.0` +- Apps-Engine: `1.25.0` + +### ๐Ÿš€ Improvements + + +- Send only relevant data via WebSocket ([#22258](https://github.com/RocketChat/Rocket.Chat/pull/22258)) + + Previously when any data changed on subscriptions or rooms we were getting fresh data from database, to also remove undesired fields, but sometimes the data that changed was not relevant so we were sending the whole object everytime **without** the fields that actually changed. This change aims to reduce this overhead and also send less data to clients. + +### ๐Ÿ› Bug fixes + + +- Support DISABLE_PRESENCE_MONITOR env var in new DB watchers ([#22257](https://github.com/RocketChat/Rocket.Chat/pull/22257)) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@sampaiodiego](https://github.com/sampaiodiego) + # 3.14.4 `2021-05-28 ยท 2 ๐Ÿ› ยท 1 ๐Ÿ” ยท 2 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index d61bf33ee47..bf25f6b809d 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "3.15.0" + "version": "3.15.1" } diff --git a/package-lock.json b/package-lock.json index 51f5a9744e8..00bf0f85e97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "3.15.0", + "version": "3.15.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e1062719d6f..04f2aea32ab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "3.15.0", + "version": "3.15.1", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" From 2bc6ea49dd68e6bc6c6882c6dbf10aff78767b5b Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Sun, 27 Jun 2021 23:12:27 -0300 Subject: [PATCH 5/9] [FIX] Visitor info screen being updated multiple times (#22482) --- .../views/room/Header/Omnichannel/QuickActions/QuickActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx b/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx index 9cea78ed6a0..0857985721e 100644 --- a/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx +++ b/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx @@ -69,7 +69,7 @@ const QuickActions: FC = ({ room, className }) => { useEffect(() => { getVisitorEmail(); - }, [room, getVisitorEmail]); + }, [visitorRoomId, getVisitorEmail]); const closeModal = useCallback(() => setModal(null), [setModal]); From ebb83a004bb217935b46bcf2deb7ed4208fde762 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Sun, 27 Jun 2021 23:12:27 -0300 Subject: [PATCH 6/9] [FIX] Visitor info screen being updated multiple times (#22482) --- .../views/room/Header/Omnichannel/QuickActions/QuickActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx b/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx index 9cea78ed6a0..0857985721e 100644 --- a/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx +++ b/client/views/room/Header/Omnichannel/QuickActions/QuickActions.tsx @@ -69,7 +69,7 @@ const QuickActions: FC = ({ room, className }) => { useEffect(() => { getVisitorEmail(); - }, [room, getVisitorEmail]); + }, [visitorRoomId, getVisitorEmail]); const closeModal = useCallback(() => setModal(null), [setModal]); From 5b7cfb8f4fe3d7dc52fcc8329636d5a718e9ee10 Mon Sep 17 00:00:00 2001 From: Renato Becker Date: Wed, 9 Jun 2021 09:28:06 -0300 Subject: [PATCH 7/9] [FIX] Sound notification is not emitted when the Omnichannel chat comes from another department (#22291) --- app/livechat/client/lib/stream/queueManager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/livechat/client/lib/stream/queueManager.js b/app/livechat/client/lib/stream/queueManager.js index 69b91393feb..526c5158cf4 100644 --- a/app/livechat/client/lib/stream/queueManager.js +++ b/app/livechat/client/lib/stream/queueManager.js @@ -33,7 +33,10 @@ const events = { return LivechatInquiry.remove(inquiry._id); } delete inquiry.type; - LivechatInquiry.upsert({ _id: inquiry._id }, { ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) }); + const saveResult = LivechatInquiry.upsert({ _id: inquiry._id }, { ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) }); + if (saveResult?.insertedId) { + newInquirySound(); + } }, removed: (inquiry) => LivechatInquiry.remove(inquiry._id), }; From 4eee82c638c4c6b0d48c265a7dfe82c21858711d Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Sun, 13 Jun 2021 23:35:54 -0300 Subject: [PATCH 8/9] [FIX][ENTERPRISE] Omnichannel enterprise permissions being added back to its default roles (#22322) --- app/authorization/server/startup.js | 48 +++++++++---------- .../livechat-enterprise/server/permissions.js | 36 +------------- 2 files changed, 26 insertions(+), 58 deletions(-) diff --git a/app/authorization/server/startup.js b/app/authorization/server/startup.js index 67db2ac1e2b..654b2d88acb 100644 --- a/app/authorization/server/startup.js +++ b/app/authorization/server/startup.js @@ -91,37 +91,37 @@ Meteor.startup(function() { { _id: 'view-broadcast-member-list', roles: ['admin', 'owner', 'moderator'] }, { _id: 'call-management', roles: ['admin', 'owner', 'moderator'] }, { _id: 'create-invite-links', roles: ['admin', 'owner', 'moderator'] }, - { _id: 'view-l-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] }, - { _id: 'view-livechat-manager', roles: ['livechat-manager', 'admin'] }, - { _id: 'edit-omnichannel-contact', roles: ['livechat-manager', 'admin', 'livechat-agent'] }, - { _id: 'view-livechat-rooms', roles: ['livechat-manager', 'admin'] }, - { _id: 'close-livechat-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] }, - { _id: 'close-others-livechat-room', roles: ['livechat-manager', 'admin'] }, - { _id: 'on-hold-livechat-room', roles: ['livechat-agent', 'livechat-manager', 'admin'] }, - { _id: 'on-hold-others-livechat-room', roles: ['livechat-manager', 'admin'] }, - { _id: 'save-others-livechat-room-info', roles: ['livechat-manager'] }, - { _id: 'remove-closed-livechat-rooms', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-analytics', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-queue', roles: ['livechat-agent', 'livechat-manager', 'admin'] }, - { _id: 'transfer-livechat-guest', roles: ['livechat-manager', 'admin'] }, + { _id: 'view-l-room', roles: ['livechat-manager', 'livechat-monitor', 'livechat-agent', 'admin'] }, + { _id: 'view-livechat-manager', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'edit-omnichannel-contact', roles: ['livechat-manager', 'livechat-agent', 'admin'] }, + { _id: 'view-livechat-rooms', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'close-livechat-room', roles: ['livechat-manager', 'livechat-monitor', 'livechat-agent', 'admin'] }, + { _id: 'close-others-livechat-room', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'on-hold-livechat-room', roles: ['livechat-manager', 'livechat-monitor', 'livechat-agent', 'admin'] }, + { _id: 'on-hold-others-livechat-room', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'save-others-livechat-room-info', roles: ['livechat-manager', 'livechat-monitor'] }, + { _id: 'remove-closed-livechat-rooms', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-analytics', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-queue', roles: ['livechat-manager', 'livechat-monitor', 'livechat-agent', 'admin'] }, + { _id: 'transfer-livechat-guest', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, { _id: 'manage-livechat-managers', roles: ['livechat-manager', 'admin'] }, - { _id: 'manage-livechat-agents', roles: ['livechat-manager', 'admin'] }, - { _id: 'manage-livechat-departments', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-departments', roles: ['livechat-manager', 'admin'] }, - { _id: 'add-livechat-department-agents', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-current-chats', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-real-time-monitoring', roles: ['livechat-manager', 'admin'] }, + { _id: 'manage-livechat-agents', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'manage-livechat-departments', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-departments', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'add-livechat-department-agents', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-current-chats', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-real-time-monitoring', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, { _id: 'view-livechat-triggers', roles: ['livechat-manager', 'admin'] }, { _id: 'view-livechat-customfields', roles: ['livechat-manager', 'admin'] }, { _id: 'view-livechat-installation', roles: ['livechat-manager', 'admin'] }, { _id: 'view-livechat-appearance', roles: ['livechat-manager', 'admin'] }, { _id: 'view-livechat-webhooks', roles: ['livechat-manager', 'admin'] }, { _id: 'view-livechat-facebook', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-business-hours', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-room-closed-same-department', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-room-closed-by-another-agent', roles: ['livechat-manager', 'admin'] }, - { _id: 'view-livechat-room-customfields', roles: ['livechat-manager', 'livechat-agent', 'admin'] }, - { _id: 'edit-livechat-room-customfields', roles: ['livechat-manager', 'livechat-agent', 'admin'] }, + { _id: 'view-livechat-business-hours', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-room-closed-same-department', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-room-closed-by-another-agent', roles: ['livechat-manager', 'livechat-monitor', 'admin'] }, + { _id: 'view-livechat-room-customfields', roles: ['livechat-manager', 'livechat-monitor', 'livechat-agent', 'admin'] }, + { _id: 'edit-livechat-room-customfields', roles: ['livechat-manager', 'livechat-monitor', 'livechat-agent', 'admin'] }, { _id: 'send-omnichannel-chat-transcript', roles: ['livechat-manager', 'admin'] }, { _id: 'mail-messages', roles: ['admin'] }, { _id: 'toggle-room-e2e-encryption', roles: ['owner'] }, diff --git a/ee/app/livechat-enterprise/server/permissions.js b/ee/app/livechat-enterprise/server/permissions.js index 445efeaa646..1744231d9e2 100644 --- a/ee/app/livechat-enterprise/server/permissions.js +++ b/ee/app/livechat-enterprise/server/permissions.js @@ -1,5 +1,3 @@ -import _ from 'underscore'; - import { Permissions, Roles } from '../../../../app/models/server'; export const createPermissions = () => { @@ -11,41 +9,11 @@ export const createPermissions = () => { const livechatManagerRole = 'livechat-manager'; const adminRole = 'admin'; - const roles = _.pluck(Roles.find().fetch(), 'name'); - if (roles.indexOf(livechatMonitorRole) === -1) { + const monitorRole = Roles.findOneById(livechatMonitorRole, { fields: { _id: 1 } }); + if (!monitorRole) { Roles.createOrUpdate(livechatMonitorRole); } - const permissions = [ - 'view-l-room', - 'view-livechat-rooms', - 'close-livechat-room', - 'close-others-livechat-room', - 'on-hold-livechat-room', - 'on-hold-others-livechat-room', - 'save-others-livechat-room-info', - 'remove-closed-livechat-rooms', - 'view-livechat-analytics', - 'add-livechat-department-agents', - 'view-livechat-queue', - 'transfer-livechat-guest', - 'view-livechat-manager', - 'view-livechat-departments', - 'view-livechat-current-chats', - 'view-livechat-analytics', - 'view-livechat-real-time-monitoring', - 'view-livechat-business-hours', - 'manage-livechat-agents', - 'view-livechat-room-closed-same-department', - 'view-livechat-room-closed-by-another-agent', - 'view-livechat-room-customfields', - 'edit-livechat-room-customfields', - 'manage-livechat-departments', - ]; - - - permissions.map((p) => Permissions.addRole(p, livechatMonitorRole)); - Permissions.create('manage-livechat-units', [adminRole, livechatManagerRole]); Permissions.create('manage-livechat-monitors', [adminRole, livechatManagerRole]); Permissions.create('manage-livechat-tags', [adminRole, livechatManagerRole]); From 766afc1e5f9a7410ad0714e64112e4fb6b08f30f Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Sun, 27 Jun 2021 23:14:56 -0300 Subject: [PATCH 9/9] Bump version to 3.15.2 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 41 ++++++++++++++++++++++++++ .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- HISTORY.md | 27 ++++++++++++++++- app/utils/rocketchat.info | 2 +- package-lock.json | 2 +- package.json | 2 +- 8 files changed, 73 insertions(+), 7 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index b74c9314e53..5bb222e20da 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 3.15.1 +ENV RC_VERSION 3.15.2 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index 9f6c905ffff..54466aa0947 100644 --- a/.github/history.json +++ b/.github/history.json @@ -61142,6 +61142,47 @@ ] } ] + }, + "3.15.2": { + "node_version": "12.22.1", + "npm_version": "6.14.1", + "apps_engine_version": "1.26.0", + "mongo_versions": [ + "3.4", + "3.6", + "4.0", + "4.2" + ], + "pull_requests": [ + { + "pr": "22322", + "title": "[FIX][ENTERPRISE] Omnichannel enterprise permissions being added back to its default roles", + "userLogin": "sampaiodiego", + "description": "Fix omnichannel monitor permissions being added back to omnichannel monitor role on every startup.", + "milestone": "3.15.2", + "contributors": [ + "sampaiodiego" + ] + }, + { + "pr": "22291", + "title": "[FIX] Sound notification is not emitted when the Omnichannel chat comes from another department", + "userLogin": "renatobecker", + "milestone": "3.15.2", + "contributors": [ + "renatobecker" + ] + }, + { + "pr": "22482", + "title": "[FIX] Visitor info screen being updated multiple times", + "userLogin": "sampaiodiego", + "milestone": "3.15.2", + "contributors": [ + "sampaiodiego" + ] + } + ] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 7fafc6b7147..ae5d3666dec 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/3.15.1/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/3.15.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 2a93a393f8a..2199a6b0341 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 3.15.1 +version: 3.15.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 7bc8cd8c02e..0aa56bba4b5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,29 @@ +# 3.15.2 +`2021-06-27 ยท 3 ๐Ÿ› ยท 2 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `12.22.1` +- NPM: `6.14.1` +- MongoDB: `3.4, 3.6, 4.0, 4.2` +- Apps-Engine: `1.26.0` + +### ๐Ÿ› Bug fixes + + +- **ENTERPRISE:** Omnichannel enterprise permissions being added back to its default roles ([#22322](https://github.com/RocketChat/Rocket.Chat/pull/22322)) + + Fix omnichannel monitor permissions being added back to omnichannel monitor role on every startup. + +- Sound notification is not emitted when the Omnichannel chat comes from another department ([#22291](https://github.com/RocketChat/Rocket.Chat/pull/22291)) + +- Visitor info screen being updated multiple times ([#22482](https://github.com/RocketChat/Rocket.Chat/pull/22482)) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@renatobecker](https://github.com/renatobecker) +- [@sampaiodiego](https://github.com/sampaiodiego) + # 3.15.1 `2021-06-21 ยท 3 ๐Ÿ› ยท 3 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` @@ -2600,7 +2625,7 @@ - [@tiagoevanp](https://github.com/tiagoevanp) # 3.11.5 -`2021-04-20 ยท 1 ๐Ÿ› ยท 1 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` +`2021-06-27 ยท 1 ๐Ÿ› ยท 1 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` ### Engine versions - Node: `12.18.4` diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index bf25f6b809d..07f0b79a1ad 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "3.15.1" + "version": "3.15.2" } diff --git a/package-lock.json b/package-lock.json index 00bf0f85e97..80481abf4b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "3.15.1", + "version": "3.15.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 04f2aea32ab..59b418aa4f7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "3.15.1", + "version": "3.15.2", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/"