Skip to content

Conversation

@juliajforesti
Copy link
Contributor

@juliajforesti juliajforesti commented Sep 16, 2025

ARCH-1757

Proposed changes (including videos or screenshots)

Default behavior from endpoint engagement-dashboard/channels/list is to only return rooms that are not empty:

  • remove hideRoomsWithNoActivity param from engagement-dashboard/channels/list enpoint
  • remove hideRoomsWithNoActivity param usage
  • adjust tests

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Breaking Changes

    • Engagement Dashboard API no longer accepts hideRoomsWithNoActivity; the channels list now always excludes rooms with no messages. Update clients to stop sending this parameter.
  • Improvements

    • More consistent channel analytics: empty rooms are no longer included in results by default.
  • Tests

    • Updated end-to-end tests to validate the absence of empty rooms and behavior without the deprecated parameter.
  • Chores

    • Bumped @rocket.chat/meteor to a new major version.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 16, 2025

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 Sep 16, 2025

🦋 Changeset detected

Latest commit: edabe3c

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

This PR includes changesets to release 38 packages
Name Type
@rocket.chat/meteor Major
@rocket.chat/core-typings Major
@rocket.chat/rest-typings Major
@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/freeswitch Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-client Major
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@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/license 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 Major
@rocket.chat/ui-voip Major
@rocket.chat/instance-status Patch
@rocket.chat/omni-core 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 Sep 16, 2025

Walkthrough

Removes the deprecated hideRoomsWithNoActivity parameter across client, server API, and server lib. Updates the channels listing to always source data from Analytics and exclude empty rooms by default. Adjusts E2E tests accordingly. Adds a changeset indicating a major version bump and documents the breaking API change.

Changes

Cohort / File(s) Summary of changes
Release notes & versioning
/.changeset/shaggy-otters-think.md
Adds changeset for @rocket.chat/meteor with a major bump; documents removal of hideRoomsWithNoActivity and resulting behavior change.
Client hook (Engagement Dashboard)
apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts
Drops payload field hideRoomsWithNoActivity from GET /v1/engagement-dashboard/channels/list call; keeps other params and response shaping unchanged.
EE API endpoint (channels list)
apps/meteor/ee/server/api/engagementDashboard/channels.ts
Removes support and validation for hideRoomsWithNoActivity; updates endpoint param typing; simplifies destructuring and service call; removes deprecation logging.
EE server lib (channels data source)
apps/meteor/ee/server/lib/engagementDashboard/channels.ts
Updates findChannelsWithNumberOfMessages to remove hideRoomsWithNoActivity; always queries Analytics.findRoomsByTypesWithNumberOfMessagesBetweenDate; removes findAllChannelsWithNumberOfMessages; adjusts imports; explicit empty-result handling.
E2E tests (API)
apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts
Removes usage of hideRoomsWithNoActivity; adds emptyRoom fixture to assert empty rooms are not returned; ensures activity in testRoom; updates/renames tests and lifecycle setup/cleanup.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Admin UI
  participant CL as useChannelsList (Client)
  participant API as GET /v1/engagement-dashboard/channels/list
  participant SVC as findChannelsWithNumberOfMessages
  participant DB as Analytics

  UI->>CL: Request channels { start, end, offset, count }
  note over CL: Removed param: hideRoomsWithNoActivity
  CL->>API: GET with { start, end, offset, count }
  API->>SVC: Invoke with dates + options
  SVC->>DB: findRoomsByTypesWithNumberOfMessagesBetweenDate(...)
  DB-->>SVC: { channels[], total }
  SVC-->>API: { channels, total }
  API-->>CL: Response (non-empty rooms only)
  CL-->>UI: Render list
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ricardogarim
  • cardoso
  • dougfabris

Poem

A hop, a skip, a tidy sweep—
We drop a flag long put to sleep.
Through Analytics, signals bloom,
No empty echoes in the room.
Thump-thump! my paws approve this feat—
Clean paths, clear lists, and metrics sweet.
🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore!: remove hideRoomsWithNoActivity param" succinctly and accurately describes the primary change in the PR: removal of the hideRoomsWithNoActivity parameter. It directly reflects the changes in the endpoint, server logic, helper functions, and tests shown in the summary. The conventional-commit style with "!" appropriately signals a breaking change and is clear to reviewers scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove/hideRoomsWithNoActivity

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

@juliajforesti juliajforesti changed the base branch from develop to release-8.0.0 September 16, 2025 14:27
@juliajforesti juliajforesti added this to the 8.0.0 milestone Sep 16, 2025
@juliajforesti juliajforesti force-pushed the remove/hideRoomsWithNoActivity branch from f9977de to f53c43b Compare September 16, 2025 14:32
@codecov
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.37%. Comparing base (3c42f0d) to head (edabe3c).
⚠️ Report is 97 commits behind head on release-8.0.0.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.0.0   #36951      +/-   ##
=================================================
- Coverage          66.43%   66.37%   -0.07%     
=================================================
  Files               3276     3312      +36     
  Lines             109596   111670    +2074     
  Branches           20860    20937      +77     
=================================================
+ Hits               72814    74123    +1309     
- Misses             34116    34872     +756     
- Partials            2666     2675       +9     
Flag Coverage Δ
e2e 58.26% <ø> (+0.41%) ⬆️
unit 70.86% <ø> (-0.71%) ⬇️

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.

@MartinSchoeler MartinSchoeler added the stat: QA assured Means it has been tested and approved by a company insider label Sep 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 16, 2025
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: 0

🧹 Nitpick comments (4)
.changeset/shaggy-otters-think.md (1)

5-5: Polish the changeset summary (mark as breaking and tighten wording).

Clearer and aligns with the actual endpoint path and behavior.

-Removes the deprecated param `hideRoomsWithNoActivity` and adjust the api tests accordingly. Endpoint always returns rooms that are not empty.
+BREAKING: remove deprecated `hideRoomsWithNoActivity` param from `/v1/engagement-dashboard/channels/list`; endpoint now always excludes empty rooms. Tests updated accordingly.
apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts (2)

177-209: Counts/diff assertions LGTM; minor flake guard suggestion.

Consider capturing now = Date.now() once per test and deriving start/end from it to avoid boundary drift.

- end: new Date().toISOString(),
- start: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
+ const now = Date.now();
+ end: new Date(now).toISOString(),
+ start: new Date(now - 7 * 24 * 60 * 60 * 1000).toISOString(),

211-244: Remove duplicate tests (identical name and body).

These two blocks duplicate earlier tests verbatim; they increase runtime and noise.

-it('should correctly count messages diff compared to last week when there are messages in a room', async () => {
-  // ...duplicate of lines 177-209...
-});
-
-it('should correctly count messages from last week and diff when moving to the next week', async () => {
-  // ...duplicate of lines 245-277...
-});

Also applies to: 279-312

apps/meteor/ee/server/lib/engagementDashboard/channels.ts (1)

49-52: Tweak the comment for accuracy.

toArray() yields an array; it won’t be undefined. The guard is fine; adjust the comment to avoid confusion.

-// The aggregation result may be undefined if there are no matching analytics or corresponding rooms in the period
+// The aggregation may return an empty array if there are no matching analytics/rooms for the period
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08551e1 and edabe3c.

📒 Files selected for processing (5)
  • .changeset/shaggy-otters-think.md (1 hunks)
  • apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts (0 hunks)
  • apps/meteor/ee/server/api/engagementDashboard/channels.ts (2 hunks)
  • apps/meteor/ee/server/lib/engagementDashboard/channels.ts (1 hunks)
  • apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts (5 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts (2)
packages/core-typings/src/IRoom.ts (1)
  • IRoom (19-91)
apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
  • deleteRoom (48-50)
🪛 Biome (2.1.2)
apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts

[error] 26-29: Disallow duplicate setup and teardown hooks.

Disallow before duplicacy inside the describe function.

(lint/suspicious/noDuplicateTestHooks)

🔇 Additional comments (9)
apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts (5)

24-34: Good addition of an explicit empty-room fixture.

Creation and cleanup look correct and isolated.


123-123: Seeding a message before assertions is correct.

Ensures non-empty activity for deterministic expectations.


156-175: Validation for excluding empty rooms looks right.

Search by _id against emptyRoom is a precise check.


245-277: Future-window diff assertions are consistent with the new default behavior.

Verifies inclusion with messages = 0 and correct lastWeekMessages/diff—good coverage.


16-21: Fix duplicate Mocha hooks (Biome error)

Two top-level before hooks in the same describe trigger noDuplicateTestHooks — convert the permission setup to beforeEach and await the async call. Run Biome after applying the change.

File: apps/meteor/tests/end-to-end/api/34-engagement-dashboard.ts (lines 16-21)

 before((done) => getCredentials(done));
-
-before(() => updatePermission('view-engagement-dashboard', ['admin']));
+beforeEach(async () => {
+	await updatePermission('view-engagement-dashboard', ['admin']);
+});
 
 after(() => updatePermission('view-engagement-dashboard', ['admin']));
apps/meteor/ee/server/api/engagementDashboard/channels.ts (2)

13-13: REST typings updated correctly (param removal).

Signature reflects the breaking change; return shape unchanged.


54-68: Param handling and response shaping LGTM.

  • Validates dates, paginates via getPaginationItems.
  • Calls the lib without the removed flag.
  • Returns count: channels.length (consistent with API convention).
apps/meteor/ee/server/lib/engagementDashboard/channels.ts (2)

40-47: Data source switch to Analytics is appropriate.

Pagination passed through; date windows computed correctly.


54-59: Return passthrough LGTM.

Shape aligns with the API layer.

@ggazzo ggazzo merged commit c0bac52 into release-8.0.0 Sep 16, 2025
71 of 73 checks passed
@ggazzo ggazzo deleted the remove/hideRoomsWithNoActivity branch September 16, 2025 21:01
ggazzo pushed a commit that referenced this pull request Oct 3, 2025
ggazzo pushed a commit that referenced this pull request Nov 4, 2025
ggazzo pushed a commit that referenced this pull request Nov 5, 2025
ggazzo pushed a commit that referenced this pull request Nov 5, 2025
ggazzo pushed a commit that referenced this pull request Nov 5, 2025
ggazzo pushed a commit that referenced this pull request Nov 6, 2025
ggazzo pushed a commit that referenced this pull request Dec 2, 2025
ggazzo pushed a commit that referenced this pull request Dec 9, 2025
gaolin1 pushed a commit to gaolin1/medsense.webchat that referenced this pull request Jan 6, 2026
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.

4 participants