diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index 31cb2fd20b77b..b74c9314e53d8 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 c58a362aef73f..9f6c905ffff5b 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 cc09b0cb4903b..7fafc6b71475f 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 c3c6ff78a11e5..2a93a393f8af1 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 de8922c402468..7bc8cd8c02e68 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/lib/getURL.js b/app/utils/lib/getURL.js index 4042d57414a10..9e93b614abd2a 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/app/utils/rocketchat.info b/app/utils/rocketchat.info index d61bf33ee47f1..bf25f6b809dd1 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/client/components/Message/Attachments/Files/ImageAttachment.tsx b/client/components/Message/Attachments/Files/ImageAttachment.tsx index b81d49005e61b..3c2b1d4b11d5b 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 95d66e1770486..3e69067df7cdf 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 }), diff --git a/client/startup/routes.ts b/client/startup/routes.ts index d2bf3c9372d06..cd29aaeb8ab10 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 }); }, }; diff --git a/package-lock.json b/package-lock.json index 51f5a9744e802..00bf0f85e9712 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 e1062719d6f2f..04f2aea32ab9a 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/" diff --git a/server/modules/watchers/watchers.module.ts b/server/modules/watchers/watchers.module.ts index a6f856a4413d0..61a21e1f7d480 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) {