From f960b382bf7316c162cee485e37f958e191e371f Mon Sep 17 00:00:00 2001 From: Matheus Cardoso Date: Fri, 13 Mar 2026 14:20:37 -0300 Subject: [PATCH 1/2] chore(deps): upgrade ws from 8.18 to 8.19 (#39429) --- apps/meteor/ee/server/services/package.json | 4 +-- ee/apps/ddp-streamer/package.json | 4 +-- packages/ddp-client/package.json | 4 +-- yarn.lock | 29 ++++++++++++++------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index faa30754cab95..0ddf878f18d64 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -44,7 +44,7 @@ "pino": "^8.21.0", "sodium-native": "^4.3.3", "sodium-plus": "^0.9.0", - "ws": "~8.18.3" + "ws": "~8.19.0" }, "devDependencies": { "@rocket.chat/icons": "~0.47.0", @@ -54,7 +54,7 @@ "@types/express": "^4.17.25", "@types/fibers": "^3.1.4", "@types/node": "~22.16.5", - "@types/ws": "^8.5.13", + "@types/ws": "^8.18.1", "npm-run-all": "^4.1.5", "pino-pretty": "^7.6.1", "ts-node": "^10.9.2", diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index e5d72fb9e84d9..c460a5dcbf24a 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -45,7 +45,7 @@ "sharp": "^0.33.5", "underscore": "^1.13.7", "uuid": "^11.0.3", - "ws": "~8.18.3" + "ws": "~8.19.0" }, "devDependencies": { "@rocket.chat/apps-engine": "workspace:^", @@ -56,7 +56,7 @@ "@types/prometheus-gc-stats": "^0.6.4", "@types/underscore": "^1.13.0", "@types/uuid": "^10.0.0", - "@types/ws": "^8.5.13", + "@types/ws": "^8.18.1", "eslint": "~9.39.3", "pino-pretty": "^7.6.1", "ts-node": "^10.9.2", diff --git a/packages/ddp-client/package.json b/packages/ddp-client/package.json index f1a7d65174693..9c21e1551c127 100644 --- a/packages/ddp-client/package.json +++ b/packages/ddp-client/package.json @@ -25,12 +25,12 @@ "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/tsconfig": "workspace:*", "@types/jest": "~30.0.0", - "@types/ws": "^8.5.13", + "@types/ws": "^8.18.1", "eslint": "~9.39.3", "jest": "~30.2.0", "jest-websocket-mock": "~2.5.0", "typescript": "~5.9.3", - "ws": "~8.18.3" + "ws": "~8.19.0" }, "peerDependencies": { "@rocket.chat/emitter": "*" diff --git a/yarn.lock b/yarn.lock index f49420cef9f99..d46f407b7d62b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9020,12 +9020,12 @@ __metadata: "@rocket.chat/rest-typings": "workspace:^" "@rocket.chat/tsconfig": "workspace:*" "@types/jest": "npm:~30.0.0" - "@types/ws": "npm:^8.5.13" + "@types/ws": "npm:^8.18.1" eslint: "npm:~9.39.3" jest: "npm:~30.2.0" jest-websocket-mock: "npm:~2.5.0" typescript: "npm:~5.9.3" - ws: "npm:~8.18.3" + ws: "npm:~8.19.0" peerDependencies: "@rocket.chat/emitter": "*" languageName: unknown @@ -9054,7 +9054,7 @@ __metadata: "@types/prometheus-gc-stats": "npm:^0.6.4" "@types/underscore": "npm:^1.13.0" "@types/uuid": "npm:^10.0.0" - "@types/ws": "npm:^8.5.13" + "@types/ws": "npm:^8.18.1" colorette: "npm:^1.4.0" ejson: "npm:^2.2.3" eslint: "npm:~9.39.3" @@ -9074,7 +9074,7 @@ __metadata: typescript: "npm:~5.9.3" underscore: "npm:^1.13.7" uuid: "npm:^11.0.3" - ws: "npm:~8.18.3" + ws: "npm:~8.19.0" languageName: unknown linkType: soft @@ -15185,6 +15185,15 @@ __metadata: languageName: node linkType: hard +"@types/ws@npm:^8.18.1": + version: 8.18.1 + resolution: "@types/ws@npm:8.18.1" + dependencies: + "@types/node": "npm:*" + checksum: 10/1ce05e3174dcacf28dae0e9b854ef1c9a12da44c7ed73617ab6897c5cbe4fccbb155a20be5508ae9a7dde2f83bd80f5cf3baa386b934fc4b40889ec963e94f3a + languageName: node + linkType: hard + "@types/ws@npm:^8.5.10, @types/ws@npm:^8.5.13": version: 8.5.13 resolution: "@types/ws@npm:8.5.13" @@ -33687,7 +33696,7 @@ __metadata: "@types/express": "npm:^4.17.25" "@types/fibers": "npm:^3.1.4" "@types/node": "npm:~22.16.5" - "@types/ws": "npm:^8.5.13" + "@types/ws": "npm:^8.18.1" ajv: "npm:^8.17.1" bcrypt: "npm:^5.1.1" body-parser: "npm:^1.20.4" @@ -33709,7 +33718,7 @@ __metadata: sodium-plus: "npm:^0.9.0" ts-node: "npm:^10.9.2" typescript: "npm:~5.9.3" - ws: "npm:~8.18.3" + ws: "npm:~8.19.0" languageName: unknown linkType: soft @@ -38492,9 +38501,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:~8.18.3": - version: 8.18.3 - resolution: "ws@npm:8.18.3" +"ws@npm:~8.19.0": + version: 8.19.0 + resolution: "ws@npm:8.19.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -38503,7 +38512,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 10/725964438d752f0ab0de582cd48d6eeada58d1511c3f613485b5598a83680bedac6187c765b0fe082e2d8cc4341fc57707c813ae780feee82d0c5efe6a4c61b6 + checksum: 10/26e4901e93abaf73af9f26a93707c95b4845e91a7a347ec8c569e6e9be7f9df066f6c2b817b2d685544e208207898a750b78461e6e8d810c11a370771450c31b languageName: node linkType: hard From 02b00d1fad4c3ca279e8451c0e59904a803a9d60 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Fri, 13 Mar 2026 18:39:33 -0300 Subject: [PATCH 2/2] test: Flaky expect star the thread message (#39615) --- .../e2ee-encrypted-channels.spec.ts | 4 ++-- apps/meteor/tests/e2e/message-actions.spec.ts | 6 +++--- .../page-objects/fragments/home-content.ts | 14 ++++++------- .../meteor/tests/e2e/quote-attachment.spec.ts | 6 +++--- apps/meteor/tests/e2e/quote-messages.spec.ts | 10 +++++----- apps/meteor/tests/e2e/team-management.spec.ts | 2 +- apps/meteor/tests/e2e/threads.spec.ts | 20 +++++++++---------- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts b/apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts index bc5e101dbf3e4..489a46d3b2951 100644 --- a/apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts +++ b/apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts @@ -102,8 +102,8 @@ test.describe('E2EE Encrypted Channels', () => { await poHomeChannel.content.toggleAlsoSendThreadToChannel(true); await page.getByRole('dialog').locator('[name="msg"]').last().fill('This is an encrypted thread message also sent in channel'); await page.keyboard.press('Enter'); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText('This is an encrypted thread message also sent in channel'); - await expect(poHomeChannel.content.lastThreadMessageText.locator('.rcx-icon--name-key')).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText('This is an encrypted thread message also sent in channel'); + await expect(poHomeChannel.content.lastUserThreadMessage.locator('.rcx-icon--name-key')).toBeVisible(); await expect(poHomeChannel.content.lastThreadMessagePreview).toContainText('This is an encrypted thread message also sent in channel'); await expect(poHomeChannel.content.mainThreadMessageText).toContainText('This is the thread main message.'); await expect(poHomeChannel.content.mainThreadMessageText.locator('.rcx-icon--name-key')).toBeVisible(); diff --git a/apps/meteor/tests/e2e/message-actions.spec.ts b/apps/meteor/tests/e2e/message-actions.spec.ts index 787a6fd7df311..d39a3ea33c808 100644 --- a/apps/meteor/tests/e2e/message-actions.spec.ts +++ b/apps/meteor/tests/e2e/message-actions.spec.ts @@ -38,7 +38,7 @@ test.describe.serial('message-actions', () => { await page.locator('.rcx-vertical-bar').locator(`role=textbox[name="Message #${targetChannel}"]`).type('this is a reply message'); await page.keyboard.press('Enter'); - await expect(poHomeChannel.content.lastThreadMessageText).toHaveText('this is a reply message'); + await expect(poHomeChannel.content.lastUserThreadMessage).toHaveText('this is a reply message'); }); // with thread open we listen to the subscription and update the collection from there @@ -48,7 +48,7 @@ test.describe.serial('message-actions', () => { await poHomeChannel.content.openReplyInThread(); await page.getByRole('dialog').locator(`role=textbox[name="Message #${targetChannel}"]`).fill('this is a reply message'); await page.keyboard.press('Enter'); - await expect(poHomeChannel.content.lastThreadMessageText).toHaveText('this is a reply message'); + await expect(poHomeChannel.content.lastUserThreadMessage).toHaveText('this is a reply message'); }); await test.step('unfollow thread', async () => { @@ -73,7 +73,7 @@ test.describe.serial('message-actions', () => { await poHomeChannel.content.openReplyInThread(); await page.locator('.rcx-vertical-bar').locator(`role=textbox[name="Message #${targetChannel}"]`).fill('this is a reply message'); await page.keyboard.press('Enter'); - await expect(poHomeChannel.content.lastThreadMessageText).toHaveText('this is a reply message'); + await expect(poHomeChannel.content.lastUserThreadMessage).toHaveText('this is a reply message'); }); // close thread before testing because the behavior changes diff --git a/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts b/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts index 2577cd557216e..0b0831603651d 100644 --- a/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts +++ b/apps/meteor/tests/e2e/page-objects/fragments/home-content.ts @@ -65,6 +65,10 @@ export class HomeContent { return this.messageListItems.last(); } + get lastUserThreadMessage(): Locator { + return this.threadMessageListItems.last(); + } + get lastThreadMessagePreview(): Locator { return this.page.getByRole('listitem').locator('[role="link"][aria-roledescription="thread message preview"]').last(); } @@ -269,10 +273,6 @@ export class HomeContent { return this.threadMessageListItems.first(); } - get lastThreadMessageText(): Locator { - return this.threadMessageListItems.last(); - } - get lastThreadMessagePreviewText(): Locator { return this.page.locator('div.messages-box ul.messages-list [role=link]').last(); } @@ -417,9 +417,9 @@ export class HomeContent { } async openLastThreadMessageMenu(): Promise { - await this.threadMessageList.last().hover(); - await this.threadMessageList.last().getByRole('button', { name: 'More', exact: true }).waitFor(); - await this.threadMessageList.last().getByRole('button', { name: 'More', exact: true }).click(); + await this.lastUserThreadMessage.hover(); + await this.lastUserThreadMessage.getByRole('button', { name: 'More', exact: true }).waitFor(); + await this.lastUserThreadMessage.getByRole('button', { name: 'More', exact: true }).click(); } async toggleAlsoSendThreadToChannel(isChecked: boolean): Promise { diff --git a/apps/meteor/tests/e2e/quote-attachment.spec.ts b/apps/meteor/tests/e2e/quote-attachment.spec.ts index 8b20af3ae54c7..86f7c639205ba 100644 --- a/apps/meteor/tests/e2e/quote-attachment.spec.ts +++ b/apps/meteor/tests/e2e/quote-attachment.spec.ts @@ -80,7 +80,7 @@ test.describe.parallel('Quote Attachment', () => { }); await test.step('Quote the message with attachment in thread', async () => { - await poHomeChannel.content.lastThreadMessageText.hover(); + await poHomeChannel.content.lastUserThreadMessage.hover(); await poHomeChannel.content.btnQuoteMessage.click(); // Verify the quote preview shows both file and description @@ -94,10 +94,10 @@ test.describe.parallel('Quote Attachment', () => { }); await test.step('Verify the quoted message appears correctly in thread', async () => { - await expect(poHomeChannel.content.lastThreadMessageText).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage).toBeVisible(); await expect(poHomeChannel.content.threadMessageQuotedFileDescription(fileDescription)).toBeVisible(); await expect(poHomeChannel.content.threadMessageQuotedFileName(textFileName)).toBeVisible(); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText(threadQuoteMessage); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText(threadQuoteMessage); }); }); diff --git a/apps/meteor/tests/e2e/quote-messages.spec.ts b/apps/meteor/tests/e2e/quote-messages.spec.ts index 72d944be30091..46c308d235035 100644 --- a/apps/meteor/tests/e2e/quote-messages.spec.ts +++ b/apps/meteor/tests/e2e/quote-messages.spec.ts @@ -216,11 +216,11 @@ test.describe.serial('Quote Messages', () => { await poHomeChannel.content.openReplyInThread(); await expect(page).toHaveURL(/.*thread/); await poHomeChannel.content.sendMessageInThread(threadMessage); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText(threadMessage); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText(threadMessage); }); await test.step('Quote message in DM thread', async () => { - await poHomeChannel.content.lastThreadMessageText.hover(); + await poHomeChannel.content.lastUserThreadMessage.hover(); await poHomeChannel.content.btnQuoteMessage.click(); await expect(poHomeChannel.content.threadQuotePreview).toBeVisible(); await expect(poHomeChannel.content.threadQuotePreview).toContainText(threadMessage); @@ -228,9 +228,9 @@ test.describe.serial('Quote Messages', () => { }); await test.step('Verify quoted message appears in DM thread', async () => { - await expect(poHomeChannel.content.lastThreadMessageText).toBeVisible(); - await expect(poHomeChannel.content.lastThreadMessageText.locator('blockquote')).toBeVisible(); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText(quoteText); + await expect(poHomeChannel.content.lastUserThreadMessage).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage.locator('blockquote')).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText(quoteText); }); }); }); diff --git a/apps/meteor/tests/e2e/team-management.spec.ts b/apps/meteor/tests/e2e/team-management.spec.ts index a633d7748bfb4..161506d47a36b 100644 --- a/apps/meteor/tests/e2e/team-management.spec.ts +++ b/apps/meteor/tests/e2e/team-management.spec.ts @@ -149,7 +149,7 @@ test.describe.serial('teams-management', () => { await poHomeTeam.content.openReplyInThread(); await page.locator('.rcx-vertical-bar').locator(`role=textbox[name="Message #${targetTeam}"]`).type('any-reply-message'); await page.keyboard.press('Enter'); - await expect(poHomeTeam.content.lastThreadMessageText).toHaveText('any-reply-message'); + await expect(poHomeTeam.content.lastUserThreadMessage).toHaveText('any-reply-message'); }); test('should set targetTeam as readonly', async () => { diff --git a/apps/meteor/tests/e2e/threads.spec.ts b/apps/meteor/tests/e2e/threads.spec.ts index f52212e92ba37..2ceb6e37f3c71 100644 --- a/apps/meteor/tests/e2e/threads.spec.ts +++ b/apps/meteor/tests/e2e/threads.spec.ts @@ -36,13 +36,13 @@ test.describe.serial('Threads', () => { await poHomeChannel.content.toggleAlsoSendThreadToChannel(true); await page.getByRole('dialog').locator('[name="msg"]').last().fill('This is a thread message also sent in channel'); await page.keyboard.press('Enter'); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText('This is a thread message also sent in channel'); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText('This is a thread message also sent in channel'); await expect(poHomeChannel.content.lastThreadMessagePreview).toContainText('This is a thread message also sent in channel'); }); test('expect open threads contextual bar when clicked on thread preview', async ({ page }) => { await poHomeChannel.content.lastThreadMessagePreviewText.click(); await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText('This is a thread message also sent in channel'); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText('This is a thread message also sent in channel'); }); test.describe('hideFlexTab Preference enabled for threads', () => { test.beforeAll(async ({ api }) => { @@ -64,18 +64,18 @@ test.describe.serial('Threads', () => { test('expect open threads contextual bar when clicked on thread preview', async ({ page }) => { await poHomeChannel.content.lastThreadMessagePreviewText.click(); await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText('This is a thread message also sent in channel'); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText('This is a thread message also sent in channel'); }); test('expect not to close thread contextual bar when performing some action', async ({ page }) => { await poHomeChannel.content.lastThreadMessagePreviewText.click(); await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText('This is a thread message also sent in channel'); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText('This is a thread message also sent in channel'); await poHomeChannel.content.openLastThreadMessageMenu(); await page.locator('role=menuitem[name="Copy text"]').click(); await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toContainText('This is a thread message also sent in channel'); + await expect(poHomeChannel.content.lastUserThreadMessage).toContainText('This is a thread message also sent in channel'); }); }); test('expect upload a file attachment in thread with description', async ({ page }) => { @@ -131,8 +131,8 @@ test.describe.serial('Threads', () => { }); test('expect quote the thread message', async ({ page }) => { - await poHomeChannel.content.lastThreadMessageText.hover(); - await poHomeChannel.content.lastThreadMessageText.getByRole('button', { name: 'Quote' }).click(); + await poHomeChannel.content.lastUserThreadMessage.hover(); + await poHomeChannel.content.lastUserThreadMessage.getByRole('button', { name: 'Quote' }).click(); await page.locator('[name="msg"]').last().fill('this is a quote message'); await page.keyboard.press('Enter'); @@ -168,7 +168,7 @@ test.describe.serial('Threads', () => { test('expect close thread if has only one message and user press escape', async ({ page }) => { await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage).toBeVisible(); await expect(page.locator('[name="msg"]').last()).toBeFocused(); await page.keyboard.press('Escape'); await expect(page).not.toHaveURL(/.*thread/); @@ -176,7 +176,7 @@ test.describe.serial('Threads', () => { test('expect reset the thread composer to original message if user presses escape', async ({ page }) => { await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage).toBeVisible(); await expect(page.locator('[name="msg"]').last()).toBeFocused(); await page.locator('[name="msg"]').last().fill('message to be edited'); @@ -193,7 +193,7 @@ test.describe.serial('Threads', () => { test('expect clean composer and keep the thread open if user is editing message and presses escape', async ({ page }) => { await expect(page).toHaveURL(/.*thread/); - await expect(poHomeChannel.content.lastThreadMessageText).toBeVisible(); + await expect(poHomeChannel.content.lastUserThreadMessage).toBeVisible(); await expect(page.locator('[name="msg"]').last()).toBeFocused(); await page.locator('[name="msg"]').last().fill('message to be edited');