Skip to content

fix: inquiries.take not throwing error on clientAction:true#39250

Merged
dionisio-bot[bot] merged 2 commits intodevelopfrom
fix/clientaction
Mar 2, 2026
Merged

fix: inquiries.take not throwing error on clientAction:true#39250
dionisio-bot[bot] merged 2 commits intodevelopfrom
fix/clientaction

Conversation

@KevLehman
Copy link
Member

@KevLehman KevLehman commented Mar 2, 2026

Proposed changes (including videos or screenshots)

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-1706

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where taking an inquiry would fail when chat limits were exceeded.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 2, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

🦋 Changeset detected

Latest commit: 8c577b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Walkthrough

Adds options parameter propagation to the livechat inquiries take endpoint and introduces comprehensive end-to-end tests for chat limit scenarios, including per-agent, per-department, and global limits with various blocking/allowance conditions.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/tame-dolphins-draw.md
Changelog entry documenting patch release fix for inquiries.take failure when attempting to take a chat while over chat limits.
Inquiries REST API
apps/meteor/app/livechat/imports/server/rest/inquiries.ts
Modified endpoint to pass optional options parameter to underlying takeInquiry() function call, enabling flexible control flow for chat limit handling.
Chat Limits End-to-End Tests
apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
Added extensive EE-gated test suite covering manual inquiry selection with varying agent/department/global chat limit configurations, including scenarios where operations are blocked (400) or allowed (200), and limit updates during tests. Imported new helper functions fetchInquiry() and takeInquiry().

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes a bug fix for inquiries.take not throwing errors with clientAction:true, which aligns with the PR's main objective to fix error handling when reaching chat limits.
Linked Issues check ✅ Passed The PR changes address CORE-1706 by passing the clientAction options parameter to takeInquiry, enabling proper error handling for chat limit scenarios.
Out of Scope Changes check ✅ Passed All changes directly support the objectives: updating inquiry REST endpoint to pass options, adding comprehensive E2E tests for chat limit scenarios, and documenting the fix via changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/meteor/tests/end-to-end/api/livechat/07-queue.ts (1)

1167-1171: Extract repeated “take inquiry should fail” request into a helper.

The same POST + payload + expect(400) sequence is duplicated many times; a local helper would reduce noise and future maintenance cost.

♻️ Proposed refactor
+const expectTakeInquiryToFail = async (args: {
+	inquiryId: string;
+	userId: string;
+	agentCredentials: Credentials;
+}) =>
+	request
+		.post(api('livechat/inquiries.take'))
+		.set(args.agentCredentials)
+		.send({ userId: args.userId, inquiryId: args.inquiryId, options: { clientAction: true } })
+		.expect(400);
-			await request
-				.post(api('livechat/inquiries.take'))
-				.set(manualUser.credentials)
-				.send({ userId: manualUser.user._id, inquiryId: inquiry._id, options: { clientAction: true } })
-				.expect(400);
+			await expectTakeInquiryToFail({
+				inquiryId: inquiry._id,
+				userId: manualUser.user._id,
+				agentCredentials: manualUser.credentials,
+			});

Also applies to: 1210-1214, 1279-1283, 1297-1301, 1363-1367, 1403-1407, 1453-1457

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/tests/end-to-end/api/livechat/07-queue.ts` around lines 1167 -
1171, Several test blocks repeat the same POST to livechat/inquiries.take with
the same payload and expect(400); extract this into a local helper (e.g.,
takeInquiryShouldFail or expectTakeInquiryToFail) that accepts request,
manualUser.credentials, and the inquiry._id (or the whole inquiry) and performs
request.post(api('livechat/inquiries.take')).set(manualUser.credentials).send({
userId: manualUser.user._id, inquiryId, options: { clientAction: true }
}).expect(400); replace each duplicated sequence (the occurrences using request,
api, manualUser, inquiry and expect(400)) with calls to that helper to reduce
duplication and improve readability.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/tests/end-to-end/api/livechat/07-queue.ts`:
- Around line 1084-1094: Replace the fixed sleep in the before hook with a
deterministic wait: after calling updateSetting/updateEESetting in the
before(async () => { ... }) block, poll or await a concrete condition that
proves settings are applied (for example, query the settings API or call a
helper that reads Livechat_enabled, Livechat_Routing_Method,
Omnichannel_enable_department_removal and Livechat_waiting_queue until they
return expected values), or wait for a UI/network response that reflects the
changes, instead of using sleep(1000); keep references to updateSetting,
updateEESetting and remove the hardcoded sleep call.

---

Nitpick comments:
In `@apps/meteor/tests/end-to-end/api/livechat/07-queue.ts`:
- Around line 1167-1171: Several test blocks repeat the same POST to
livechat/inquiries.take with the same payload and expect(400); extract this into
a local helper (e.g., takeInquiryShouldFail or expectTakeInquiryToFail) that
accepts request, manualUser.credentials, and the inquiry._id (or the whole
inquiry) and performs
request.post(api('livechat/inquiries.take')).set(manualUser.credentials).send({
userId: manualUser.user._id, inquiryId, options: { clientAction: true }
}).expect(400); replace each duplicated sequence (the occurrences using request,
api, manualUser, inquiry and expect(400)) with calls to that helper to reduce
duplication and improve readability.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92a3e47 and 8738e7a.

📒 Files selected for processing (2)
  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
🧠 Learnings (11)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Implement proper wait strategies for dynamic content in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
🔇 Additional comments (3)
apps/meteor/app/livechat/imports/server/rest/inquiries.ts (2)

72-72: Good fix: options is now propagated to takeInquiry.

This change aligns with the reported regression and enables clientAction-driven error behavior to reach the take-inquiry logic.


65-72: Request-schema and handler signature are properly aligned for options.clientAction.

The validator isPOSTLivechatInquiriesTakeParams explicitly defines options.clientAction as a boolean field (packages/rest-typings/src/v1/omnichannel.ts:3697-3699), and the takeInquiry function signature matches exactly with the same type structure. The end-to-end flow from REST endpoint to handler is correct.

apps/meteor/tests/end-to-end/api/livechat/07-queue.ts (1)

1075-1481: Strong regression coverage for manual-selection limit handling.

The new suite exercises the clientAction: true failure path and multiple agent/department/global limit transitions in a way that matches the bug objective.

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.69%. Comparing base (a4341ec) to head (8c577b9).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39250      +/-   ##
===========================================
- Coverage    70.71%   70.69%   -0.02%     
===========================================
  Files         3195     3195              
  Lines       113108   113108              
  Branches     20526    20489      -37     
===========================================
- Hits         79979    79957      -22     
- Misses       31082    31096      +14     
- Partials      2047     2055       +8     
Flag Coverage Δ
e2e 60.36% <ø> (-0.09%) ⬇️
e2e-api 47.79% <ø> (-0.06%) ⬇️
unit 71.33% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KevLehman KevLehman marked this pull request as ready for review March 2, 2026 16:52
@KevLehman KevLehman requested review from a team as code owners March 2, 2026 16:52
@KevLehman KevLehman added this to the 8.3.0 milestone Mar 2, 2026
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label Mar 2, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 2, 2026
@dionisio-bot dionisio-bot bot enabled auto-merge March 2, 2026 16:54
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@coderabbitai coderabbitai bot removed the type: bug label Mar 2, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/meteor/tests/end-to-end/api/livechat/07-queue.ts (1)

1167-1171: Strengthen 400-case assertions to validate UI-consumable error payloads.

Right now these checks assert only HTTP 400. Add assertions for success: false plus a stable error field (error/errorType) so the regression coverage also guarantees actionable failure semantics.

Proposed pattern
- await request
-   .post(api('livechat/inquiries.take'))
-   .set(manualUser.credentials)
-   .send({ userId: manualUser.user._id, inquiryId: inquiry._id, options: { clientAction: true } })
-   .expect(400);
+ const res = await request
+   .post(api('livechat/inquiries.take'))
+   .set(manualUser.credentials)
+   .send({ userId: manualUser.user._id, inquiryId: inquiry._id, options: { clientAction: true } })
+   .expect(400);
+
+ expect(res.body).to.have.property('success', false);
+ expect(res.body.error || res.body.errorType).to.exist;

Also applies to: 1210-1214, 1279-1283, 1297-1301, 1363-1367, 1403-1407, 1453-1457

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/tests/end-to-end/api/livechat/07-queue.ts` around lines 1167 -
1171, Replace bare HTTP 400 assertions with checks that the response body
contains UI-consumable error fields: after calling
request.post(api('livechat/inquiries.take')) (and the other similar calls at the
listed ranges), assert response.status === 400 and response.body.success ===
false and that response.body.error or response.body.errorType is present
(non-empty string). Locate the test calls using
request.post(api('livechat/inquiries.take')) / request.get(api(...)) in this
file and update the chain to capture the response (e.g., assign to a variable or
use .expect and a function) and add explicit assertions for success:false and a
stable error field for each of the occurrences mentioned (1167-1171, 1210-1214,
1279-1283, 1297-1301, 1363-1367, 1403-1407, 1453-1457).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/meteor/tests/end-to-end/api/livechat/07-queue.ts`:
- Around line 1167-1171: Replace bare HTTP 400 assertions with checks that the
response body contains UI-consumable error fields: after calling
request.post(api('livechat/inquiries.take')) (and the other similar calls at the
listed ranges), assert response.status === 400 and response.body.success ===
false and that response.body.error or response.body.errorType is present
(non-empty string). Locate the test calls using
request.post(api('livechat/inquiries.take')) / request.get(api(...)) in this
file and update the chain to capture the response (e.g., assign to a variable or
use .expect and a function) and add explicit assertions for success:false and a
stable error field for each of the occurrences mentioned (1167-1171, 1210-1214,
1279-1283, 1297-1301, 1363-1367, 1403-1407, 1453-1457).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92a3e47 and 8c577b9.

📒 Files selected for processing (3)
  • .changeset/tame-dolphins-draw.md
  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
🧠 Learnings (18)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/livechat/imports/server/rest/inquiries.ts
  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2026-03-02T16:31:30.612Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 39250
File: apps/meteor/tests/end-to-end/api/livechat/07-queue.ts:1084-1094
Timestamp: 2026-03-02T16:31:30.612Z
Learning: In E2E API tests at apps/meteor/tests/end-to-end/api/livechat/, using sleep(1000) after updateSetting() or updateEESetting() calls in test setup hooks is acceptable and intentional to allow omnichannel settings to propagate their side effects.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2026-02-04T12:09:05.769Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38374
File: apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts:26-37
Timestamp: 2026-02-04T12:09:05.769Z
Learning: In E2E tests at apps/meteor/tests/end-to-end/apps/, prefer sleeping for a fixed duration (e.g., 1 second) over implementing polling/retry logic when waiting for asynchronous operations to complete. Tests should fail deterministically if the expected result isn't available after the sleep.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Implement proper wait strategies for dynamic content in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `page.waitFor()` with specific conditions instead of hardcoded timeouts in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Avoid using `page.locator()` in Playwright tests - always prefer semantic locators such as `page.getByRole()`, `page.getByLabel()`, `page.getByText()`, or `page.getByTitle()`

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-10T19:06:20.146Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2026-02-23T17:53:18.785Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • apps/meteor/tests/end-to-end/api/livechat/07-queue.ts
  • .changeset/tame-dolphins-draw.md
🧬 Code graph analysis (1)
apps/meteor/tests/end-to-end/api/livechat/07-queue.ts (2)
apps/meteor/tests/data/livechat/rooms.ts (2)
  • fetchInquiry (157-170)
  • getLivechatRoomInfo (327-339)
apps/meteor/app/livechat/server/lib/RoutingManager.ts (1)
  • takeInquiry (230-332)
🔇 Additional comments (3)
.changeset/tame-dolphins-draw.md (1)

1-5: Changeset entry matches the bugfix intent.

Line 5 accurately documents the patch behavior change for inquiries.take.

apps/meteor/app/livechat/imports/server/rest/inquiries.ts (1)

72-72: clientAction propagation fix is correctly wired.

Line 72 now forwards request options into takeInquiry, which is the needed path for clientAction: true failures to surface properly.

apps/meteor/tests/end-to-end/api/livechat/07-queue.ts (1)

23-24: Manual-selection limit coverage is strong and directly aligned with CORE-1706.

The new suite validates the expected blocked/allowed transitions across agent, department, and global limits, including clientAction:true rejection paths.

Also applies to: 1075-1481

@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 2, 2026
@KevLehman KevLehman added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Mar 2, 2026
@dionisio-bot dionisio-bot bot removed stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels Mar 2, 2026
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label Mar 2, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 2, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 2, 2026
Merged via the queue into develop with commit 7367e3b Mar 2, 2026
82 of 86 checks passed
@dionisio-bot dionisio-bot bot deleted the fix/clientaction branch March 2, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants