From 7e8ece34e7648b2150b97ec5c4a52d599878523a Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 19 Apr 2022 15:47:47 -0300 Subject: [PATCH 1/2] [FIX] Desktop notification on multi-instance environments (#25220) --- app/notifications/server/lib/Notifications.ts | 5 +++++ server/modules/notifications/notifications.module.ts | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/app/notifications/server/lib/Notifications.ts b/app/notifications/server/lib/Notifications.ts index 0ee20a7a70e1..f1f6d46ab13f 100644 --- a/app/notifications/server/lib/Notifications.ts +++ b/app/notifications/server/lib/Notifications.ts @@ -3,6 +3,7 @@ import { DDPCommon } from 'meteor/ddp-common'; import { NotificationsModule } from '../../../../server/modules/notifications/notifications.module'; import { Streamer } from '../../../../server/modules/streamer/streamer.module'; +import { api } from '../../../../server/sdk/api'; import { Subscriptions as SubscriptionsRaw, Rooms as RoomsRaw, @@ -41,4 +42,8 @@ notifications.configure({ Settings: SettingsRaw, }); +notifications.streamLocal.on('broadcast', ({ eventName, args }) => { + api.broadcastLocal(eventName, ...args); +}); + export default notifications; diff --git a/server/modules/notifications/notifications.module.ts b/server/modules/notifications/notifications.module.ts index 5d4c4932be1e..4709014e9e6a 100644 --- a/server/modules/notifications/notifications.module.ts +++ b/server/modules/notifications/notifications.module.ts @@ -51,6 +51,8 @@ export class NotificationsModule { public readonly streamRoomData: IStreamer; + public readonly streamLocal: IStreamer; + public readonly streamPresence: IStreamer; constructor(private Streamer: IStreamerConstructor) { @@ -93,6 +95,7 @@ export class NotificationsModule { }); this.streamUser = new this.Streamer('notify-user'); + this.streamLocal = new this.Streamer('local'); } async configure({ Rooms, Subscriptions, Users, Settings }: IModelsParam): Promise { @@ -448,6 +451,11 @@ export class NotificationsModule { } }); + this.streamLocal.serverOnly = true; + this.streamLocal.allowRead('none'); + this.streamLocal.allowEmit('all'); + this.streamLocal.allowWrite('none'); + this.streamPresence.allowRead('logged'); this.streamPresence.allowWrite('none'); } From 156bf48cb82f192dc4e6a283bdb992796643a264 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Tue, 19 Apr 2022 17:17:13 -0300 Subject: [PATCH 2/2] Bump version to 4.6.3 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 23 +++++++++++++++++++++++ .snapcraft/resources/prepareRocketChat | 2 +- .snapcraft/snap/snapcraft.yaml | 2 +- HISTORY.md | 18 ++++++++++++++++++ app/utils/rocketchat.info | 2 +- package-lock.json | 2 +- package.json | 2 +- 8 files changed, 47 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index fd58ea4d1217..9490420d455e 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.6.2 +ENV RC_VERSION 4.6.3 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index 57a3e4f48887..406ba05c9d1f 100644 --- a/.github/history.json +++ b/.github/history.json @@ -73236,6 +73236,29 @@ ] } ] + }, + "4.6.3": { + "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": "25220", + "title": "[FIX] Desktop notification on multi-instance environments", + "userLogin": "sampaiodiego", + "milestone": "4.6.3", + "contributors": [ + "sampaiodiego" + ] + } + ] } } } \ No newline at end of file diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat index 1ed4a49c6519..5dc6601389fa 100755 --- a/.snapcraft/resources/prepareRocketChat +++ b/.snapcraft/resources/prepareRocketChat @@ -1,6 +1,6 @@ #!/bin/bash -curl -SLf "https://releases.rocket.chat/4.6.2/download/" -o rocket.chat.tgz +curl -SLf "https://releases.rocket.chat/4.6.3/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 9556f335e447..b5de4d45eb70 100644 --- a/.snapcraft/snap/snapcraft.yaml +++ b/.snapcraft/snap/snapcraft.yaml @@ -7,7 +7,7 @@ # 5. `snapcraft snap` name: rocketchat-server -version: 4.6.2 +version: 4.6.3 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 600fce293add..979db5e1decc 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,22 @@ +# 4.6.3 +`2022-04-19 ยท 1 ๐Ÿ› ยท 1 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### 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` + +### ๐Ÿ› Bug fixes + + +- Desktop notification on multi-instance environments ([#25220](https://github.com/RocketChat/Rocket.Chat/pull/25220)) + +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@sampaiodiego](https://github.com/sampaiodiego) + # 4.6.2 `2022-04-14 ยท 2 ๐Ÿ› ยท 2 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index b63a7bf00f29..be6b22219b64 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "4.6.2" + "version": "4.6.3" } diff --git a/package-lock.json b/package-lock.json index 84ff9020a09f..968ccf9644b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "4.6.2", + "version": "4.6.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4ca1d5407f72..707243c8ba33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "4.6.2", + "version": "4.6.3", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/"