Skip to content

Commit

Permalink
Release 6.7.1
Browse files Browse the repository at this point in the history
Release 6.7.1
  • Loading branch information
ggazzo authored Apr 24, 2024
2 parents 5eb3cbb + 6e7c5b3 commit 1d6cccf
Show file tree
Hide file tree
Showing 31 changed files with 185 additions and 84 deletions.
5 changes: 5 additions & 0 deletions .changeset/bump-patch-1713300687976.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/chilly-glasses-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Increased the timeout between calls for the three remaining Omnichannel Agenda Jobs. This should make them happen less often and reduce the load on MongoDB
5 changes: 5 additions & 0 deletions .changeset/eleven-seas-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue that forces the focus on the last message when interacting by mouse on message list
5 changes: 5 additions & 0 deletions .changeset/green-ways-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed open expanded view (galery mode) for image attachments sent by livechat widget
5 changes: 5 additions & 0 deletions .changeset/shaggy-yaks-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed an issue where Rocket.Chat would ask admins to confirm fingerprint change (new workspace vs configuration update), even when `AUTO_ACCEPT_FINGERPRINT` environment variable set to `"true"`.
5 changes: 5 additions & 0 deletions .changeset/sharp-yaks-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

Fixed supported versions not being updated in airgapped environments
5 changes: 5 additions & 0 deletions .changeset/thin-peaches-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes an issue where message reactions are vertically misaligned when zooming out
4 changes: 2 additions & 2 deletions apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export async function syncWorkspace() {
try {
await announcementSync();
await syncCloudData();
await getCachedSupportedVersionsToken.reset();
} catch (err) {
switch (true) {
case err instanceof CloudWorkspaceRegistrationError:
Expand All @@ -34,7 +33,6 @@ export async function syncWorkspace() {
});
try {
await legacySyncWorkspace();
await getCachedSupportedVersionsToken.reset();
} catch (err) {
switch (true) {
case err instanceof CloudWorkspaceRegistrationError:
Expand All @@ -52,5 +50,7 @@ export async function syncWorkspace() {
}
}
}
} finally {
await getCachedSupportedVersionsToken.reset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare module '@rocket.chat/ui-contexts' {
}

export const sendMessageLivechat = async ({
message: { token, _id, rid, msg, file, attachments },
message: { token, _id, rid, msg, file, files, attachments },
agent,
}: ISendMessageLivechat): Promise<boolean> => {
check(token, String);
Expand Down Expand Up @@ -67,6 +67,7 @@ export const sendMessageLivechat = async ({
msg,
token,
file,
files,
attachments,
},
agent,
Expand All @@ -79,7 +80,7 @@ export const sendMessageLivechat = async ({
};

Meteor.methods<ServerMethods>({
async sendMessageLivechat({ token, _id, rid, msg, file, attachments }: ILivechatMessage, agent: ILivechatMessageAgent) {
return sendMessageLivechat({ message: { token, _id, rid, msg, file, attachments }, agent });
async sendMessageLivechat({ token, _id, rid, msg, file, files, attachments }: ILivechatMessage, agent: ILivechatMessageAgent) {
return sendMessageLivechat({ message: { token, _id, rid, msg, file, files, attachments }, agent });
},
});
35 changes: 16 additions & 19 deletions apps/meteor/client/components/message/content/Reactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,22 @@ const Reactions = ({ message, ...props }: ReactionsProps): ReactElement => {
const { toolbarProps } = useToolbar(props, ref);

return (
<MessageReactions>
{message.reactions && (
<div ref={ref} {...toolbarProps} {...props}>
{Object.entries(message.reactions).map(([name, reactions]) => (
<Reaction
key={name}
counter={reactions.usernames.length}
hasReacted={hasReacted}
name={name}
names={reactions.usernames.filter((user) => user !== username).map((username) => `@${username}`)}
messageId={message._id}
onKeyDown={(e: KeyboardEvent) =>
(e.code === 'Space' || e.code === 'Enter') && toggleReactionMutation.mutate({ mid: message._id, reaction: name })
}
onClick={() => toggleReactionMutation.mutate({ mid: message._id, reaction: name })}
/>
))}
</div>
)}
<MessageReactions ref={ref} {...toolbarProps} {...props}>
{message.reactions &&
Object.entries(message.reactions).map(([name, reactions]) => (
<Reaction
key={name}
counter={reactions.usernames.length}
hasReacted={hasReacted}
name={name}
names={reactions.usernames.filter((user) => user !== username).map((username) => `@${username}`)}
messageId={message._id}
onKeyDown={(e: KeyboardEvent) =>
(e.code === 'Space' || e.code === 'Enter') && toggleReactionMutation.mutate({ mid: message._id, reaction: name })
}
onClick={() => toggleReactionMutation.mutate({ mid: message._id, reaction: name })}
/>
))}
<MessageReactionAction
title={t('Add_Reaction')}
onKeyDown={(e: KeyboardEvent) => (e.code === 'Space' || e.code === 'Enter') && openEmojiPicker(e)}
Expand Down
18 changes: 9 additions & 9 deletions apps/meteor/client/views/room/hooks/useMessageListNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const useMessageListNavigation = (): { messageListRef: RefCallback<HTMLEl
const messageListRef = useCallback(
(node: HTMLElement | null) => {
let lastMessageFocused: HTMLElement | null = null;
let triggeredByKeyboard = false;
let initialFocus = true;

if (!node) {
Expand Down Expand Up @@ -68,14 +67,15 @@ export const useMessageListNavigation = (): { messageListRef: RefCallback<HTMLEl

lastMessageFocused = document.activeElement as HTMLElement;
}

triggeredByKeyboard = true;
});

node.addEventListener(
'blur',
(e) => {
if (!triggeredByKeyboard || !(e.currentTarget instanceof HTMLElement && e.relatedTarget instanceof HTMLElement)) {
if (
!(e.relatedTarget as HTMLElement)?.classList.contains('focus-visible') ||
!(e.currentTarget instanceof HTMLElement && e.relatedTarget instanceof HTMLElement)
) {
return;
}

Expand All @@ -89,20 +89,20 @@ export const useMessageListNavigation = (): { messageListRef: RefCallback<HTMLEl
node.addEventListener(
'focus',
(e) => {
const triggeredByKeyboard = (e.target as HTMLElement)?.classList.contains('focus-visible');
if (!triggeredByKeyboard || !(e.currentTarget instanceof HTMLElement && e.relatedTarget instanceof HTMLElement)) {
return;
}

if (initialFocus) {
massageListFocusManager.focusLast({ accept: (node) => isListItem(node) });
lastMessageFocused = document.activeElement as HTMLElement;
initialFocus = false;
}

if (!triggeredByKeyboard || !(e.currentTarget instanceof HTMLElement && e.relatedTarget instanceof HTMLElement)) {
return;
}

if (lastMessageFocused && !e.currentTarget.contains(e.relatedTarget) && node.contains(e.target as HTMLElement)) {
lastMessageFocused?.focus();
lastMessageFocused = null;
triggeredByKeyboard = false;
}
},
{ capture: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AutoCloseOnHoldSchedulerClass {
mongo: (MongoInternals.defaultRemoteCollectionDriver().mongo as any).client.db(),
db: { collection: SCHEDULER_NAME },
defaultConcurrency: 1,
processEvery: '1 minute',
});

await this.scheduler.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AutoTransferChatSchedulerClass {
mongo: (MongoInternals.defaultRemoteCollectionDriver().mongo as any).client.db(),
db: { collection: SCHEDULER_NAME },
defaultConcurrency: 1,
processEvery: '1 minute',
});

await this.scheduler.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class OmnichannelQueueInactivityMonitorClass {
mongo: (MongoInternals.defaultRemoteCollectionDriver().mongo as any).client.db(),
db: { collection: SCHEDULER_NAME },
defaultConcurrency: 1,
processEvery: '1 minute',
});
this.createIndex();
const language = settings.get<string>('Language') || 'en';
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@
"@rocket.chat/favicon": "workspace:^",
"@rocket.chat/forked-matrix-appservice-bridge": "^4.0.2",
"@rocket.chat/forked-matrix-bot-sdk": "^0.6.0-beta.3",
"@rocket.chat/fuselage": "^0.53.2",
"@rocket.chat/fuselage": "^0.53.4",
"@rocket.chat/fuselage-hooks": "^0.33.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/fuselage-toastbar": "^0.31.26",
"@rocket.chat/fuselage-tokens": "^0.33.0",
"@rocket.chat/fuselage-tokens": "^0.33.1",
"@rocket.chat/fuselage-ui-kit": "workspace:^",
"@rocket.chat/gazzodown": "workspace:^",
"@rocket.chat/i18n": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/server/settings/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const verifyFingerPrint = async function () {
if (process.env.AUTO_ACCEPT_FINGERPRINT === 'true') {
logger.info('Updating fingerprint as AUTO_ACCEPT_FINGERPRINT is true', fingerprint);
await updateFingerprint(fingerprint, true);
return;
}

logger.warn('Updating fingerprint as pending for admin verification', fingerprint);
Expand Down
22 changes: 22 additions & 0 deletions apps/meteor/tests/data/livechat/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IUserCredentialsHeader, adminUsername } from '../user';
import { getRandomVisitorToken } from './users';
import { DummyResponse, sleep } from './utils';
import { Response } from 'supertest';
import { imgURL } from '../interactions';

export const createLivechatRoom = async (visitorToken: string, extraRoomParams?: Record<string, string>): Promise<IOmnichannelRoom> => {
const urlParams = new URLSearchParams();
Expand Down Expand Up @@ -208,6 +209,21 @@ export const sendMessage = (roomId: string, message: string, visitorToken: strin
});
};

export const uploadFile = (roomId: string, visitorToken: string): Promise<IMessage> => {
return new Promise((resolve, reject) => {
request
.post(api(`livechat/upload/${roomId}`))
.set({ 'x-visitor-token': visitorToken, ...credentials })
.attach('file', imgURL)
.end((err: Error, res: DummyResponse<IMessage>) => {
if (err) {
return reject(err);
}
resolve(res.body as unknown as IMessage);
});
});
};

// Sends a message using sendMessage method from agent
export const sendAgentMessage = (roomId: string, msg?: string): Promise<IMessage> => {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -243,6 +259,12 @@ export const fetchMessages = (roomId: string, visitorToken: string): Promise<IMe
if (err) {
return reject(err);
}

if (!res.body.success) {
reject(res.body);
return;
}

resolve(res.body.messages);
});
});
Expand Down
28 changes: 27 additions & 1 deletion apps/meteor/tests/e2e/messaging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,37 @@ test.describe.serial('Messaging', () => {
await poHomeChannel.sidenav.openChat(targetChannel);
await page.locator('[data-qa-type="message"]:has-text("msg1")').click();
await poHomeChannel.composer.click();
await page.locator('[data-qa-type="message"]:has-text("msg2")').click();
await page.keyboard.press('Shift+Tab');

await expect(page.locator('[data-qa-type="message"]:has-text("msg2")')).toBeFocused();
});

test('should not focus on the last message when focusing by click', async ({ page }) => {
await poHomeChannel.sidenav.openChat(targetChannel);
await page.locator('[data-qa-type="message"]:has-text("msg1")').click();

await expect(page.locator('[data-qa-type="message"]').last()).not.toBeFocused();
});

test('should focus on the recent message when moving the focus on the list and theres no previous focus', async ({ page }) => {
await poHomeChannel.sidenav.openChat(targetChannel);
await page.getByRole('button', { name: targetChannel }).first().focus();

// move focus to the list
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await expect(page.locator('[data-qa-type="message"]').last()).toBeFocused();

await page.getByRole('button', { name: targetChannel }).first().click();

// move focus to the list again
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await expect(page.locator('[data-qa-type="message"]').last()).toBeFocused();
});

test('expect show "hello word" in both contexts (targetChannel)', async ({ browser }) => {
await poHomeChannel.sidenav.openChat(targetChannel);
const { page } = await createAuxContext(browser, Users.user2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ test.describe('omnichannel-auto-onhold-chat-closing', () => {
await poLiveChat.btnSendMessageToOnlineAgent.click();
});

test('expect on-hold chat to be closed automatically in 5 seconds', async () => {
// Note: Skipping this test as the scheduler is gonna take 1 minute to process now
// And waiting for 1 minute in a test is horrible
test.skip('expect on-hold chat to be closed automatically in 5 seconds', async () => {
await agent.poHomeChannel.sidenav.openChat(newVisitor.name);
await agent.poHomeChannel.content.sendMessage('this_is_a_test_message_from_agent');

Expand Down
14 changes: 14 additions & 0 deletions apps/meteor/tests/end-to-end/api/livechat/20-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
sendAgentMessage,
createAgent,
makeAgentAvailable,
uploadFile,
} from '../../../data/livechat/rooms';
import { updateSetting } from '../../../data/permissions.helper';

Expand Down Expand Up @@ -51,5 +52,18 @@ describe('LIVECHAT - messages', () => {
expect(quotedMessageAttachments).to.have.property('text').that.is.equal(agentMsgSentence);
}
});

it('should verify if visitor is receiving a message with a image attachment', async () => {
const {
room: { _id: roomId },
visitor: { token },
} = await startANewLivechatRoomAndTakeIt();

const imgMessage = await uploadFile(roomId, token);

expect(imgMessage).to.have.property('files').that.is.an('array');
expect(imgMessage.files?.[0]).to.have.keys('_id', 'name', 'type');
expect(imgMessage).to.have.property('file').that.deep.equal(imgMessage?.files?.[0]);
});
});
});
2 changes: 1 addition & 1 deletion ee/packages/pdf-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"dependencies": {
"@react-pdf/renderer": "^3.1.14",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/fuselage-tokens": "^0.33.0",
"@rocket.chat/fuselage-tokens": "^0.33.1",
"@types/react": "~17.0.69",
"emoji-assets": "^7.0.1",
"emoji-toolkit": "^7.0.1",
Expand Down
2 changes: 1 addition & 1 deletion ee/packages/ui-theming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"devDependencies": {
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "^0.53.2",
"@rocket.chat/fuselage": "^0.53.4",
"@rocket.chat/fuselage-hooks": "^0.33.1",
"@rocket.chat/icons": "^0.34.0",
"@rocket.chat/ui-contexts": "workspace:~",
Expand Down
2 changes: 1 addition & 1 deletion packages/fuselage-ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@babel/preset-typescript": "~7.22.15",
"@rocket.chat/apps-engine": "^1.42.1",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/fuselage": "^0.53.2",
"@rocket.chat/fuselage": "^0.53.4",
"@rocket.chat/fuselage-hooks": "^0.33.1",
"@rocket.chat/fuselage-polyfills": "~0.31.25",
"@rocket.chat/icons": "^0.34.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/gazzodown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"@babel/core": "~7.22.20",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/css-in-js": "~0.31.25",
"@rocket.chat/fuselage": "^0.53.2",
"@rocket.chat/fuselage-tokens": "^0.33.0",
"@rocket.chat/fuselage": "^0.53.4",
"@rocket.chat/fuselage-tokens": "^0.33.1",
"@rocket.chat/message-parser": "workspace:^",
"@rocket.chat/styled": "~0.31.25",
"@rocket.chat/ui-client": "workspace:^",
Expand Down
Loading

0 comments on commit 1d6cccf

Please sign in to comment.