Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 6.6.2 #31849

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bump-patch-1709141264352.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Bump @rocket.chat/meteor version.
5 changes: 5 additions & 0 deletions .changeset/shy-bananas-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixed Federation not working with Microservice deployments
6 changes: 6 additions & 0 deletions .changeset/strange-lamps-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/ddp-client': patch
'@rocket.chat/meteor': patch
---

Revert unintentional changes real time presence data payload
6 changes: 6 additions & 0 deletions .changeset/young-doors-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/meteor': patch
'@rocket.chat/ddp-streamer': patch
---

Fix web UI not showing users presence updating to offline
6 changes: 4 additions & 2 deletions apps/meteor/app/notifications/client/lib/Presence.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -10,6 +10,8 @@ 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 });
Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText });
});
8 changes: 8 additions & 0 deletions apps/meteor/ee/server/local-services/federation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,12 @@ export class FederationServiceEE extends AbstractBaseFederationServiceEE impleme
await federationService.initialize();
return federationService;
}

async created(): Promise<void> {
return super.created();
}

async stopped(): Promise<void> {
return super.stopped();
}
}
14 changes: 11 additions & 3 deletions apps/meteor/server/modules/listeners/listeners.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -12,6 +12,14 @@ import type { NotificationsModule } from '../notifications/notifications.module'

const isMessageParserDisabled = process.env.DISABLE_MESSAGE_PARSER === 'true';

const STATUS_MAP: Record<UserStatus, 0 | 1 | 2 | 3> = {
[UserStatus.OFFLINE]: 0,
[UserStatus.ONLINE]: 1,
[UserStatus.AWAY]: 2,
[UserStatus.BUSY]: 3,
[UserStatus.DISABLED]: 0,
} as const;

const minimongoChangeMap: Record<string, string> = {
inserted: 'added',
updated: 'changed',
Expand Down Expand Up @@ -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);
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}
Expand Down
8 changes: 8 additions & 0 deletions apps/meteor/server/services/federation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,12 @@ export class FederationService extends AbstractBaseFederationService implements
await federationService.initialize();
return federationService;
}

public async stopped(): Promise<void> {
return super.stopped();
}

public async created(): Promise<void> {
return super.created();
}
}
2 changes: 1 addition & 1 deletion ee/apps/ddp-streamer/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 2 additions & 3 deletions ee/packages/ddp-client/src/types/streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import type {
IBanner,
LicenseLimitKind,
ICustomUserStatus,
UserStatus,
} from '@rocket.chat/core-typings';
import type * as UiKit from '@rocket.chat/ui-kit';

Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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': [
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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: "*"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: "*"
Expand Down
Loading