From 7ef940bca1225985043f372e7bfd4f8a313980ff Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Thu, 9 Jan 2025 14:46:35 +0000 Subject: [PATCH 1/3] Bump 7.2.1 --- .changeset/bump-patch-1736433994910.md | 5 +++++ yarn.lock | 30 +++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .changeset/bump-patch-1736433994910.md diff --git a/.changeset/bump-patch-1736433994910.md b/.changeset/bump-patch-1736433994910.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1736433994910.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 3760290ea9ad..38e8d7f4c072 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8757,7 +8757,7 @@ __metadata: storybook-dark-mode: "npm:^4.0.2" typescript: "npm:~5.7.2" peerDependencies: - "@rocket.chat/apps-engine": 1.48.1-rc.1 + "@rocket.chat/apps-engine": 1.48.1 "@rocket.chat/eslint-config": 0.7.0 "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" @@ -8765,10 +8765,10 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-avatar": 10.0.0-rc.3 - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-avatar": 10.0.0 + "@rocket.chat/ui-contexts": 14.0.0 "@rocket.chat/ui-kit": 0.37.0 - "@rocket.chat/ui-video-conf": 14.0.0-rc.3 + "@rocket.chat/ui-video-conf": 14.0.0 "@tanstack/react-query": "*" react: ~17.0.2 react-dom: "*" @@ -8853,8 +8853,8 @@ __metadata: "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": 0.31.31 "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 14.0.0-rc.3 - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-client": 14.0.0 + "@rocket.chat/ui-contexts": 14.0.0 katex: "*" react: "*" languageName: unknown @@ -10087,7 +10087,7 @@ __metadata: typescript: "npm:~5.7.2" peerDependencies: "@rocket.chat/fuselage": "*" - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-contexts": 14.0.0 react: ~17.0.2 languageName: unknown linkType: soft @@ -10137,8 +10137,8 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-avatar": 10.0.0-rc.3 - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-avatar": 10.0.0 + "@rocket.chat/ui-contexts": 14.0.0 react: "*" react-i18next: "*" languageName: unknown @@ -10308,8 +10308,8 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-avatar": 10.0.0-rc.3 - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-avatar": 10.0.0 + "@rocket.chat/ui-contexts": 14.0.0 react: ~17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -10365,9 +10365,9 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-avatar": 10.0.0-rc.3 - "@rocket.chat/ui-client": 14.0.0-rc.3 - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-avatar": 10.0.0 + "@rocket.chat/ui-client": 14.0.0 + "@rocket.chat/ui-contexts": 14.0.0 react: ~17.0.2 react-aria: ~3.23.1 react-dom: ^17.0.2 @@ -10455,7 +10455,7 @@ __metadata: peerDependencies: "@rocket.chat/layout": "*" "@rocket.chat/tools": 0.2.2 - "@rocket.chat/ui-contexts": 14.0.0-rc.3 + "@rocket.chat/ui-contexts": 14.0.0 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From f9e531fce6c0a9e8b9e1836eecfea189f6626bea Mon Sep 17 00:00:00 2001 From: "dionisio-bot[bot]" <117394943+dionisio-bot[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:30:26 -0300 Subject: [PATCH 2/3] fix: Start queue worker with service start instead of first call (#34918) Co-authored-by: Kevin Aleman --- .changeset/fifty-apricots-clean.md | 10 ++++++++++ .../omnichannel-services/src/QueueWorker.ts | 19 ++++--------------- 2 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 .changeset/fifty-apricots-clean.md diff --git a/.changeset/fifty-apricots-clean.md b/.changeset/fifty-apricots-clean.md new file mode 100644 index 000000000000..2c649eb707ec --- /dev/null +++ b/.changeset/fifty-apricots-clean.md @@ -0,0 +1,10 @@ +--- +"@rocket.chat/omnichannel-services": patch +"@rocket.chat/meteor": patch +--- + +Fixes a behavior when running microservices that caused queue worker to process just the first 60 seconds of request. + +This was due to a mistakenly bound context. Queue Worker was changed to start doing work only after it received the first request. + +However, with the introduction of ASL and actual context on calls, the worker registration was absorbing the context of the call that created them, causing service calls happening inside the callbacks to fail because of a timeout. diff --git a/ee/packages/omnichannel-services/src/QueueWorker.ts b/ee/packages/omnichannel-services/src/QueueWorker.ts index 5908512404a2..5950bbd128ea 100644 --- a/ee/packages/omnichannel-services/src/QueueWorker.ts +++ b/ee/packages/omnichannel-services/src/QueueWorker.ts @@ -11,14 +11,12 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { protected retryCount = 5; // Default delay is 5 seconds - protected retryDelay = 5000; + protected retryDelay = Number(process.env.RETRY_DELAY) || 5000; protected queue: MessageQueue; private logger: Logger; - private queueStarted = false; - constructor( private readonly db: Db, loggerClass: typeof Logger, @@ -28,7 +26,7 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { // eslint-disable-next-line new-cap this.logger = new loggerClass('QueueWorker'); this.queue = new MessageQueue(); - this.queue.pollingInterval = 5000; + this.queue.pollingInterval = Number(process.env.POLLING_INTERVAL) || 5000; } isServiceNotFoundMessage(message: string): boolean { @@ -46,6 +44,7 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { try { await this.createIndexes(); + this.registerWorkers(); } catch (e) { this.logger.fatal(e, 'Fatal error occurred when registering workers'); process.exit(1); @@ -55,7 +54,7 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { async createIndexes(): Promise { this.logger.info('Creating indexes for queue worker'); - // Library doesnt create indexes by itself, for some reason + // Library doesn't create indexes by itself, for some reason // This should create the indexes we need and improve queue perf on reading await this.db.collection(this.queue.collectionName).createIndex({ type: 1 }); await this.db.collection(this.queue.collectionName).createIndex({ rejectedTime: 1 }, { sparse: true }); @@ -105,8 +104,6 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { this.logger.info('Registering workers of type "workComplete"'); this.queue.registerWorker('workComplete', this.workerCallback.bind(this)); - - this.queueStarted = true; } private matchServiceCall(service: string): boolean { @@ -123,10 +120,6 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { // This is a "generic" job that allows you to call any service async queueWork>(queue: Actions, to: string, data: T): Promise { this.logger.info(`Queueing work for ${to}`); - if (!this.queueStarted) { - this.registerWorkers(); - } - if (!this.matchServiceCall(to)) { // We don't want to queue calls to invalid service names throw new Error(`Invalid service name ${to}`); @@ -150,8 +143,4 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { ]) .toArray(); } - - async isQueueStarted(): Promise { - return this.queueStarted; - } } From abf88f419ecf7b01ff21a03399f1f244acd6d760 Mon Sep 17 00:00:00 2001 From: "dionisio-bot[bot]" <117394943+dionisio-bot[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:38:01 +0000 Subject: [PATCH 3/3] fix: Slack Bridge when using multiple slack workspaces (#34946) Co-authored-by: Lucas Pelegrino <16467257+lucas-a-pelegrino@users.noreply.github.com> --- .changeset/thirty-vans-fry.md | 5 +++++ apps/meteor/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/thirty-vans-fry.md diff --git a/.changeset/thirty-vans-fry.md b/.changeset/thirty-vans-fry.md new file mode 100644 index 000000000000..909ca8b3090e --- /dev/null +++ b/.changeset/thirty-vans-fry.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixes SlackBridge service failing to connect to multiple slack workspaces diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 0160ef2abfaa..649cb54819c1 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -293,7 +293,7 @@ "@rocket.chat/ui-video-conf": "workspace:^", "@rocket.chat/ui-voip": "workspace:^", "@rocket.chat/web-ui-registration": "workspace:^", - "@slack/bolt": "^4.1.0", + "@slack/bolt": "^3.22.0", "@slack/rtm-api": "^7.0.1", "@tanstack/react-query": "^4.36.1", "@vector-im/matrix-bot-sdk": "0.7.1-element.6",