From a09416ebede5a0166f8c0d5ca72a4851b12f1e75 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 28 Feb 2024 17:27:44 +0000 Subject: [PATCH 1/4] Bump 6.6.2 --- .changeset/bump-patch-1709141264352.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1709141264352.md diff --git a/.changeset/bump-patch-1709141264352.md b/.changeset/bump-patch-1709141264352.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1709141264352.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index e43d51516fe1..09e8467357b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9348,9 +9348,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 "@rocket.chat/ui-kit": 0.33.0 - "@rocket.chat/ui-video-conf": 4.0.0 + "@rocket.chat/ui-video-conf": 4.0.1 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9432,14 +9432,14 @@ __metadata: ts-jest: ~29.1.1 typescript: ~5.3.2 peerDependencies: - "@rocket.chat/core-typings": 6.6.0 + "@rocket.chat/core-typings": 6.6.1 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 4.0.0 - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-client": 4.0.1 + "@rocket.chat/ui-contexts": 4.0.1 katex: "*" react: "*" languageName: unknown @@ -10621,7 +10621,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 react: ~17.0.2 languageName: unknown linkType: soft @@ -10796,7 +10796,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -10885,7 +10885,7 @@ __metadata: peerDependencies: "@rocket.chat/layout": "*" "@rocket.chat/tools": 0.2.1 - "@rocket.chat/ui-contexts": 4.0.0 + "@rocket.chat/ui-contexts": 4.0.1 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 329ae41d2735f5e149d3384cd8ebe32103f76dbf Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 28 Feb 2024 19:03:16 +0530 Subject: [PATCH 2/4] fix: make lifecycle methods part of inherited class in federation services (#31844) --- .changeset/shy-bananas-repeat.md | 5 +++++ .../meteor/ee/server/local-services/federation/service.ts | 8 ++++++++ apps/meteor/server/services/federation/service.ts | 8 ++++++++ 3 files changed, 21 insertions(+) create mode 100644 .changeset/shy-bananas-repeat.md diff --git a/.changeset/shy-bananas-repeat.md b/.changeset/shy-bananas-repeat.md new file mode 100644 index 000000000000..8fe1388897a2 --- /dev/null +++ b/.changeset/shy-bananas-repeat.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed Federation not working with Microservice deployments diff --git a/apps/meteor/ee/server/local-services/federation/service.ts b/apps/meteor/ee/server/local-services/federation/service.ts index a1272f5c8661..15f661a29e63 100644 --- a/apps/meteor/ee/server/local-services/federation/service.ts +++ b/apps/meteor/ee/server/local-services/federation/service.ts @@ -207,4 +207,12 @@ export class FederationServiceEE extends AbstractBaseFederationServiceEE impleme await federationService.initialize(); return federationService; } + + async created(): Promise { + return super.created(); + } + + async stopped(): Promise { + return super.stopped(); + } } diff --git a/apps/meteor/server/services/federation/service.ts b/apps/meteor/server/services/federation/service.ts index be154cee4a68..931cb9248e6e 100644 --- a/apps/meteor/server/services/federation/service.ts +++ b/apps/meteor/server/services/federation/service.ts @@ -330,4 +330,12 @@ export class FederationService extends AbstractBaseFederationService implements await federationService.initialize(); return federationService; } + + public async stopped(): Promise { + return super.stopped(); + } + + public async created(): Promise { + return super.created(); + } } From 5abac60f19cbe3073d605c22e6e4eac7642c4160 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 23 Feb 2024 18:27:19 -0300 Subject: [PATCH 3/4] fix: revert status websocket payload changes (#31823) --- .changeset/strange-lamps-taste.md | 6 ++++++ .../app/notifications/client/lib/Presence.ts | 9 +++++++-- .../server/modules/listeners/listeners.module.ts | 14 +++++++++++--- .../modules/notifications/notifications.module.ts | 4 ++-- ee/packages/ddp-client/src/types/streams.ts | 5 ++--- 5 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 .changeset/strange-lamps-taste.md diff --git a/.changeset/strange-lamps-taste.md b/.changeset/strange-lamps-taste.md new file mode 100644 index 000000000000..88b61f5e5dec --- /dev/null +++ b/.changeset/strange-lamps-taste.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/ddp-client': patch +'@rocket.chat/meteor': patch +--- + +Revert unintentional changes real time presence data payload diff --git a/apps/meteor/app/notifications/client/lib/Presence.ts b/apps/meteor/app/notifications/client/lib/Presence.ts index 8cff2ed84f61..dff4ecb0392f 100644 --- a/apps/meteor/app/notifications/client/lib/Presence.ts +++ b/apps/meteor/app/notifications/client/lib/Presence.ts @@ -1,4 +1,4 @@ -import type { UserStatus } from '@rocket.chat/core-typings'; +import { UserStatus } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Presence } from '../../../../client/lib/presence'; @@ -10,6 +10,11 @@ new Meteor.Streamer('user-presence'); type args = [username: string, statusChanged?: UserStatus, statusText?: string]; +export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED]; + Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => { - Presence.notify({ _id: uid, username, status: statusChanged, statusText }); + if (!statusChanged) { + return; + } + Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText }); }); diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index 49a3017af81c..ecaab84b2fac 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -2,7 +2,7 @@ import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definition/settings'; import type { IServiceClass } from '@rocket.chat/core-services'; import { EnterpriseSettings } from '@rocket.chat/core-services'; -import { isSettingColor, isSettingEnterprise } from '@rocket.chat/core-typings'; +import { isSettingColor, isSettingEnterprise, UserStatus } from '@rocket.chat/core-typings'; import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; import { Logger } from '@rocket.chat/logger'; import { parse } from '@rocket.chat/message-parser'; @@ -12,6 +12,14 @@ import type { NotificationsModule } from '../notifications/notifications.module' const isMessageParserDisabled = process.env.DISABLE_MESSAGE_PARSER === 'true'; +const STATUS_MAP: Record = { + [UserStatus.OFFLINE]: 0, + [UserStatus.ONLINE]: 1, + [UserStatus.AWAY]: 2, + [UserStatus.BUSY]: 3, + [UserStatus.DISABLED]: 0, +} as const; + const minimongoChangeMap: Record = { inserted: 'added', updated: 'changed', @@ -145,10 +153,10 @@ export class ListenersModule { return; } - notifications.notifyLoggedInThisInstance('user-status', [_id, username, status, statusText, name, roles]); + notifications.notifyLoggedInThisInstance('user-status', [_id, username, STATUS_MAP[status], statusText, name, roles]); if (_id) { - notifications.sendPresence(_id, username, status, statusText); + notifications.sendPresence(_id, username, STATUS_MAP[status], statusText); } }); diff --git a/apps/meteor/server/modules/notifications/notifications.module.ts b/apps/meteor/server/modules/notifications/notifications.module.ts index 73cede2cd36c..75a2935d5616 100644 --- a/apps/meteor/server/modules/notifications/notifications.module.ts +++ b/apps/meteor/server/modules/notifications/notifications.module.ts @@ -1,5 +1,5 @@ import { Authorization, VideoConf } from '@rocket.chat/core-services'; -import type { ISubscription, IOmnichannelRoom, IUser, UserStatus } from '@rocket.chat/core-typings'; +import type { ISubscription, IOmnichannelRoom, IUser } from '@rocket.chat/core-typings'; import { Rooms, Subscriptions, Users, Settings } from '@rocket.chat/models'; import type { StreamerCallbackArgs, StreamKeys, StreamNames } from '@rocket.chat/ui-contexts'; import type { IStreamer, IStreamerConstructor, IPublication } from 'meteor/rocketchat:streamer'; @@ -531,7 +531,7 @@ export class NotificationsModule { return this.streamUser.emitWithoutBroadcast(`${userId}/${eventName}`, ...args); } - sendPresence(uid: string, ...args: [username: string, status?: UserStatus, statusText?: string]): void { + sendPresence(uid: string, ...args: [username: string, status?: 0 | 1 | 2 | 3, statusText?: string]): void { emit(uid, [args]); return this.streamPresence.emitWithoutBroadcast(uid, args); } diff --git a/ee/packages/ddp-client/src/types/streams.ts b/ee/packages/ddp-client/src/types/streams.ts index 806ee0c639ef..5609e707742e 100644 --- a/ee/packages/ddp-client/src/types/streams.ts +++ b/ee/packages/ddp-client/src/types/streams.ts @@ -24,7 +24,6 @@ import type { IBanner, LicenseLimitKind, ICustomUserStatus, - UserStatus, } from '@rocket.chat/core-typings'; import type * as UiKit from '@rocket.chat/ui-kit'; @@ -243,7 +242,7 @@ export interface StreamerEvents { [ uid: IUser['_id'], username: IUser['username'], - status: UserStatus, + status: 0 | 1 | 2 | 3, statusText: IUser['statusText'], name: IUser['name'], roles: IUser['roles'], @@ -325,7 +324,7 @@ export interface StreamerEvents { }, ]; - 'user-presence': [{ key: string; args: [[username: string, statusChanged?: UserStatus, statusText?: string]] }]; + 'user-presence': [{ key: string; args: [[username: string, statusChanged?: 0 | 1 | 2 | 3, statusText?: string]] }]; // TODO: rename to 'integration-history' 'integrationHistory': [ From 36a31fa395790ba85320d9c4a351f1bf34bcdf53 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 28 Feb 2024 10:32:26 -0300 Subject: [PATCH 4/4] fix: client ignoring offline presence updates (#31833) --- .changeset/young-doors-bathe.md | 6 ++++++ apps/meteor/app/notifications/client/lib/Presence.ts | 3 --- ee/apps/ddp-streamer/package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/young-doors-bathe.md diff --git a/.changeset/young-doors-bathe.md b/.changeset/young-doors-bathe.md new file mode 100644 index 000000000000..24d004b5214e --- /dev/null +++ b/.changeset/young-doors-bathe.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/meteor': patch +'@rocket.chat/ddp-streamer': patch +--- + +Fix web UI not showing users presence updating to offline diff --git a/apps/meteor/app/notifications/client/lib/Presence.ts b/apps/meteor/app/notifications/client/lib/Presence.ts index dff4ecb0392f..09d0e3be1693 100644 --- a/apps/meteor/app/notifications/client/lib/Presence.ts +++ b/apps/meteor/app/notifications/client/lib/Presence.ts @@ -13,8 +13,5 @@ type args = [username: string, statusChanged?: UserStatus, statusText?: string]; export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED]; Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => { - if (!statusChanged) { - return; - } Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText }); }); diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 1a399758265c..65340aa2887e 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.2.5", + "version": "0.2.5-next.1", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json",