Skip to content

test(apps): add tests for ModifyDeleter accessor#39796

Open
tanayyo1 wants to merge 4 commits intoRocketChat:developfrom
tanayyo1:test/add-modify-deleter-tests
Open

test(apps): add tests for ModifyDeleter accessor#39796
tanayyo1 wants to merge 4 commits intoRocketChat:developfrom
tanayyo1:test/add-modify-deleter-tests

Conversation

@tanayyo1
Copy link
Copy Markdown

@tanayyo1 tanayyo1 commented Mar 21, 2026

Fixes #39795

adds test coverage for ModifyDeleter in packages/apps-engine/src/server/accessors/. covers all 4 methods:

  • deleteRoom — verifies bridge delegation
  • deleteMessage — verifies bridge delegation
  • deleteUsers — verifies bridge delegation for both APP and BOT types, checks return value
  • removeUsersFromRoom — verifies normal case, boundary (exactly 50 users), and throws when exceeding 50-user limit

follows the same Alsatian pattern used by the existing accessor tests (ModifyCreator, ModifyUpdater, ModifyExtender).

Summary by CodeRabbit

  • Tests
    • Added tests verifying deletion and user-management operations delegate correctly to backend bridges (room, message, user).
    • Added input-boundary test ensuring removing >50 users from a room errors and prevents the removal call.
    • Ensured mocks are cleaned up after each test to avoid side effects.

Fixes RocketChat#39795

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tanayyo1 tanayyo1 requested a review from a team as a code owner March 21, 2026 11:52
Copilot AI review requested due to automatic review settings March 21, 2026 11:52
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 21, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

⚠️ No Changeset found

Latest commit: 505386b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 21, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Added a new test suite for the ModifyDeleter accessor that mocks bridges and verifies delegation for room, message, and user deletion methods, including a boundary test asserting removeUsersFromRoom rejects >50 usernames and does not call the bridge.

Changes

Cohort / File(s) Summary
ModifyDeleter Test Suite
packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
New test file that builds mocked AppBridges (RoomBridge, MessageBridge, UserBridge) and verifies each public ModifyDeleter method delegates to the correct bridge with expected arguments. Includes a boundary test ensuring removeUsersFromRoom throws when passed 51 usernames and that the bridge is not invoked.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

type: chore

🚥 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 clearly summarizes the primary change: adding tests for the ModifyDeleter accessor, directly addressing the PR's main objective.
Linked Issues check ✅ Passed The PR fulfills all coding requirements from issue #39795: comprehensive test coverage for ModifyDeleter methods including the 50-user limit validation for removeUsersFromRoom.
Out of Scope Changes check ✅ Passed All changes are scoped to the test file for ModifyDeleter; no out-of-scope modifications to unrelated code or functionality are present.
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
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds missing Alsatian unit tests for the ModifyDeleter accessor in packages/apps-engine, aligning its coverage with the other modify accessors and validating its bridge delegation and 50-user guard behavior.

Changes:

  • Introduces a new ModifyDeleter accessor spec verifying delegation for deleteRoom, deleteMessage, and deleteUsers.
  • Adds coverage for removeUsersFromRoom for normal usage, the 50-user boundary, and exceeding-limit error behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +122 to +124
const tooManyUsers = Array.from({ length: 51 }, (_, i) => `user${i}`);

await Expect(async () => md.removeUsersFromRoom('room-id', tooManyUsers)).toThrowAsync();
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

The "exceeding 50-user limit" test currently only asserts that some error is thrown. To ensure this specifically covers the guard in ModifyDeleter.removeUsersFromRoom (and not an unrelated failure), assert the thrown error type/message (e.g. Error with the exact message) and consider also spying on doRemoveUsers to verify it is not invoked when the limit is exceeded.

Suggested change
const tooManyUsers = Array.from({ length: 51 }, (_, i) => `user${i}`);
await Expect(async () => md.removeUsersFromRoom('room-id', tooManyUsers)).toThrowAsync();
const spRemove = SpyOn(this.mockRoomBridge, 'doRemoveUsers');
const tooManyUsers = Array.from({ length: 51 }, (_, i) => `user${i}`);
await Expect(async () => md.removeUsersFromRoom('room-id', tooManyUsers)).toThrowAsync(Error);
Expect(this.mockRoomBridge.doRemoveUsers).not.toHaveBeenCalled();
spRemove.restore();

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
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 1 file

@d-gubert
Copy link
Copy Markdown
Member

Hi, we're migrating away from the Alsatian framework for tests here #37592

So we won't be accepting files that add new Alsatian tests

@tanayyo1
Copy link
Copy Markdown
Author

got it, will convert to node:test

1 similar comment
@tanayyo1
Copy link
Copy Markdown
Author

got it, will convert to node:test

@tanayyo1 tanayyo1 force-pushed the test/add-modify-deleter-tests branch from a9c0021 to f0a3140 Compare March 24, 2026 12:56
@tanayyo1 tanayyo1 force-pushed the test/add-modify-deleter-tests branch from f0a3140 to 22c494e Compare March 24, 2026 13:32
Copy link
Copy Markdown
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)
packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts (1)

88-90: Add explicit call-count assertion for the second deleteUsers invocation

On Line 88 and Line 89, assert total calls are exactly 2 after the second invocation to avoid false positives if extra calls are introduced.

Suggested patch
 		await md.deleteUsers('app-id', UserType.BOT);
+		assert.strictEqual(spy.mock.calls.length, 2);
 		assert.deepStrictEqual(spy.mock.calls[1].arguments, ['app-id', UserType.BOT]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts` around
lines 88 - 90, After calling md.deleteUsers('app-id', UserType.BOT) a second
time, add an explicit assertion that the spy was called exactly twice (e.g.,
assert.strictEqual(spy.mock.calls.length, 2) or equivalent) before asserting the
arguments for the second call; this ensures no extra unexpected calls are
present when checking spy.mock.calls[1].arguments for the deleteUsers invocation
in ModifyDeleter.test.ts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts`:
- Around line 88-90: After calling md.deleteUsers('app-id', UserType.BOT) a
second time, add an explicit assertion that the spy was called exactly twice
(e.g., assert.strictEqual(spy.mock.calls.length, 2) or equivalent) before
asserting the arguments for the second call; this ensures no extra unexpected
calls are present when checking spy.mock.calls[1].arguments for the deleteUsers
invocation in ModifyDeleter.test.ts.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e11512d0-0ed9-4f71-a7d6-fed5eab22cf7

📥 Commits

Reviewing files that changed from the base of the PR and between f0a3140 and 22c494e.

📒 Files selected for processing (1)
  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.
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.
Learnt from: Harxhit
Repo: RocketChat/Rocket.Chat PR: 39476
File: apps/meteor/server/methods/addAllUserToRoom.ts:0-0
Timestamp: 2026-03-09T18:39:21.178Z
Learning: In apps/meteor/server/methods/addAllUserToRoom.ts, the implementation uses a single cursor pass (Users.find(userFilter).batchSize(100)) that collects both the full user objects (collectedUsers: IUser[]) and their usernames (usernames: string[]) in one iteration. `beforeAddUserToRoom` is then called once with the full usernames batch (preserving batch-validation semantics), and the subsequent subscription/message processing loop iterates over the same stable `collectedUsers` array — no second DB query is made. This avoids any race condition between validation and processing while preserving the original batch-validation behavior.
📚 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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2025-10-06T20:30:45.540Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/storage/storage.ts:101-122
Timestamp: 2025-10-06T20:30:45.540Z
Learning: In `packages/apps-engine/tests/test-data/storage/storage.ts`, the stub methods (updatePartialAndReturnDocument, updateStatus, updateSetting, updateAppInfo, updateMarketplaceInfo) intentionally throw "Method not implemented." Tests using these methods must stub them using `SpyOn` from the test library rather than relying on actual implementations.

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2026-03-16T11:57:17.987Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 39657
File: apps/meteor/tests/end-to-end/apps/app-resolve-visitor.ts:43-45
Timestamp: 2026-03-16T11:57:17.987Z
Learning: In `apps/meteor/tests/end-to-end/apps/app-resolve-visitor.ts`, `externalIds` lookups are namespaced per `app.id`. Because `cleanupApps()` is called before each test run and a fresh app is installed (giving a new unique `app.id`), fixed `userId` strings like `'nonexistent-id'` in null-path tests are safe and cannot collide with stale visitor records from previous runs. Do not flag these as needing unique/random values.

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2026-03-19T14:53:45.726Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39701
File: packages/apps-engine/tests/test-data/storage/storage.ts:13-23
Timestamp: 2026-03-19T14:53:45.726Z
Learning: In `packages/apps-engine/tests/test-data/storage/storage.ts`, the `TestsAppStorage` singleton pattern (via `TestsAppStorage.getInstance()`) is intentional. The maintainer (d-gubert) has confirmed that potential cross-test state leakage from the process-wide singleton is not a concern for this test suite. Do not flag this as a state-leakage or flaky-test risk in future reviews.

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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 `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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 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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
🔇 Additional comments (1)
packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts (1)

56-125: Good coverage and migration direction

This suite cleanly validates bridge delegation and the 50-user guard, and it uses node:test/node:assert instead of Alsatian as requested.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.58%. Comparing base (147fa09) to head (acaaa60).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39796      +/-   ##
===========================================
- Coverage    70.61%   70.58%   -0.03%     
===========================================
  Files         3257     3257              
  Lines       115789   115789              
  Branches     21022    21037      +15     
===========================================
- Hits         81759    81733      -26     
- Misses       31968    31996      +28     
+ Partials      2062     2060       -2     
Flag Coverage Δ
unit 71.08% <ø> (-0.04%) ⬇️

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.

@tanayyo1
Copy link
Copy Markdown
Author

Converted to node:test — renamed .spec.ts to .test.ts, switched from Alsatian decorators to describe/it/assert from node:test and node:assert. Ready for re-review.

Copy link
Copy Markdown
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)
packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts (1)

37-37: Tighten deleteUsers mock parameter typing to match production contract.

Use UserType.BOT | UserType.APP instead of UserType in the mock signature to keep compile-time checks aligned with UserBridge.doDeleteUsersCreatedByApp.

♻️ Proposed typing refinement
-			doDeleteUsersCreatedByApp(appId: string, userType: UserType): Promise<boolean> {
+			doDeleteUsersCreatedByApp(appId: string, userType: UserType.BOT | UserType.APP): Promise<boolean> {
 				return Promise.resolve(true);
 			},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts` at line
37, The mock for deleteUsers currently types its parameter as UserType (too
broad); update the mock signature to accept only UserType.BOT | UserType.APP to
match the production contract used by UserBridge.doDeleteUsersCreatedByApp. Find
the mock implementation named deleteUsers in the test and change the parameter
type to the union (UserType.BOT | UserType.APP) so TypeScript enforces the same
constraints as the real doDeleteUsersCreatedByApp.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts`:
- Line 37: The mock for deleteUsers currently types its parameter as UserType
(too broad); update the mock signature to accept only UserType.BOT |
UserType.APP to match the production contract used by
UserBridge.doDeleteUsersCreatedByApp. Find the mock implementation named
deleteUsers in the test and change the parameter type to the union (UserType.BOT
| UserType.APP) so TypeScript enforces the same constraints as the real
doDeleteUsersCreatedByApp.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98408c09-c840-46f1-91a5-12fe4eb859b9

📥 Commits

Reviewing files that changed from the base of the PR and between 22c494e and 505386b.

📒 Files selected for processing (1)
  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
🧠 Learnings (10)
📓 Common learnings
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.
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.
📚 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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2025-10-06T20:30:45.540Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/storage/storage.ts:101-122
Timestamp: 2025-10-06T20:30:45.540Z
Learning: In `packages/apps-engine/tests/test-data/storage/storage.ts`, the stub methods (updatePartialAndReturnDocument, updateStatus, updateSetting, updateAppInfo, updateMarketplaceInfo) intentionally throw "Method not implemented." Tests using these methods must stub them using `SpyOn` from the test library rather than relying on actual implementations.

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
📚 Learning: 2026-03-16T11:57:17.987Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 39657
File: apps/meteor/tests/end-to-end/apps/app-resolve-visitor.ts:43-45
Timestamp: 2026-03-16T11:57:17.987Z
Learning: In `apps/meteor/tests/end-to-end/apps/app-resolve-visitor.ts`, `externalIds` lookups are namespaced per `app.id`. Because `cleanupApps()` is called before each test run and a fresh app is installed (giving a new unique `app.id`), fixed `userId` strings like `'nonexistent-id'` in null-path tests are safe and cannot collide with stale visitor records from previous runs. Do not flag these as needing unique/random values.

Applied to files:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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 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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.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:

  • packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts
🔇 Additional comments (3)
packages/apps-engine/tests/server/accessors/ModifyDeleter.test.ts (3)

18-54: Solid test isolation and cleanup setup.

beforeEach reinitialization plus afterEach mock.restoreAll() keeps cases isolated and avoids leaked spies across tests.


56-91: Good delegation verification for delete operations.

These cases correctly assert both bridge delegation arguments and call counts, including the second deleteUsers invocation path.


93-126: Boundary and guard coverage for removeUsersFromRoom is complete.

You covered normal, exact-limit (50), and over-limit (51) scenarios, and also assert no bridge call on rejection. Great regression protection for the limit check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No test coverage for ModifyDeleter accessor

3 participants