Skip to content

fix: ContextualBar state and refresh behavior on custom sounds#38442

Merged
kodiakhq[bot] merged 14 commits intodevelopfrom
fix/custom-sounds-bug
Feb 10, 2026
Merged

fix: ContextualBar state and refresh behavior on custom sounds#38442
kodiakhq[bot] merged 14 commits intodevelopfrom
fix/custom-sounds-bug

Conversation

@nazabucciarelli
Copy link
Contributor

@nazabucciarelli nazabucciarelli commented Jan 30, 2026

Proposed changes (including videos or screenshots)

These small changes fix the three problems described on the task ticket:

  • EditSound.tsx: Adding await before the handleSave function call solved that the list of custom sounds doesn't refresh when updating some of them after clicking "Save". Making the close prop not optional and passing it from parent components downstream in order to close the sidebar after saving, both in create and update operations.
  • EditCustomSound.tsx: The Custom Sound data in the right sidebar wasn't being updated after selecting a different custom sound, it was always being returned the first one of the request's result (you can check the return sounds[0] line) because it seems that at some point in the past, the _id query parameter was being taken in the backend and returned an array with a single value. Modifying the custom-sounds.list backend endpoint to receive and handle the _id query parameter corrected the behavior. Furthermore, the refetch?.() line was removed from handleChange() since it's unneeded to refetch the edited Custom Sound after updating it because the list itself is updated upstream.
  • AddCustomSound.tsx‎ Add close() after adding a new Custom Sounds to improve UX.

Additionally to the above mentioned, an end-to-end test will be added to ensure the _id query parameter in the custom-sounds.list endpoint is properly managed and this will not be removed in the future, breaking this feature again.

Issue(s)

CORE-1789 Bugs when trying to edit custom sounds

Steps to test or reproduce

Further comments

On the ticket's comments you can observe a video of the behavior after the made modifications.

Summary by CodeRabbit

  • Bug Fixes

    • Dialog now automatically closes after successfully saving a custom sound.
    • Sidebar/contextual bar state and refresh behavior for Custom Sounds fixed for more consistent updates.
  • Improvements

    • Editor reliably loads and filters custom sounds, including direct lookup by sound ID.
  • Tests

    • Added end-to-end test covering fetching a custom sound by its ID.
  • Chores

    • Added patch release note documenting the fix.

also closes: ARCH-1542

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 30, 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 Jan 30, 2026

🦋 Changeset detected

Latest commit: f92ff82

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

This PR includes changesets to release 40 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

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 Jan 30, 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

Thread a mandatory close callback through Add/Edit custom-sound components and call it after successful save; adjust EditCustomSound data fetching to query by _id; extend server list API/schema to filter by _id; add an E2E test and a changeset release note.

Changes

Cohort / File(s) Summary
Release documentation
/.changeset/hip-melons-bow.md
Add patch changeset noting Custom Sounds contextualbar state/refresh fix.
Add component
apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx
Call close() after successful insertOrUpdateSound so the UI (sidebar/modal) closes on save.
Edit components
apps/meteor/client/views/admin/customSounds/EditCustomSound.tsx, apps/meteor/client/views/admin/customSounds/EditSound.tsx
Make close prop required and pass it through; fetch sound by _id in EditCustomSound; EditSound now awaits save, calls close() on successful save, and triggers onChange after save completes. Public prop signatures updated to require close: () => void.
Server API
apps/meteor/app/api/server/v1/custom-sounds.ts
Add optional _id to request type and schema; include _id in Mongo filter when present to allow listing by _id.
Tests
apps/meteor/tests/end-to-end/api/custom-sounds.ts
Add E2E test verifying custom-sounds.list with _id returns the single matching sound and correct pagination metadata.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant User
    participant UI as Client (Sidebar)
    participant API as Server API
    participant DB as Database

    User->>UI: open sound for edit (select _id)
    UI->>API: GET /custom-sounds?_id=<id>
    API->>DB: find { _id: <id>, ...filters }
    DB-->>API: sound data
    API-->>UI: sound data
    User->>UI: click Save
    UI->>API: POST/PUT /custom-sounds (payload)
    API->>DB: insert/update sound
    DB-->>API: result
    API-->>UI: success
    UI->>UI: await save completion, call onChange to refresh list
    UI->>UI: call close() to dismiss sidebar
    UI-->>User: sidebar closed, list refreshed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through code with tiny feet,
I taught the sidebar when to close and meet,
IDs now fetch the sound that's true,
Save completes — the list refreshes too,
A little hop, and all is new. 🎶

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main fix: addressing ContextualBar state and refresh behavior issues in custom sounds functionality.
Linked Issues check ✅ Passed All three coding objectives from CORE-1789 are fully addressed: sidebar data now updates correctly [EditCustomSound.tsx, EditSound.tsx], list refreshes immediately on save [EditSound.tsx await], and sidebar closes after save [EditSound.tsx, AddCustomSound.tsx].
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the CORE-1789 issues: UI state management, list refresh behavior, sidebar closing, and backend filtering support with corresponding test coverage.

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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

@nazabucciarelli
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx (1)

33-72: ⚠️ Potential issue | 🟡 Minor

Add close to saveAction dependency array and remove inline // FIXME comment.

close is a prop captured within the callback but missing from the dependency list, which can cause stale closure bugs if the prop reference changes. The inline // FIXME comment violates the no-comments-in-implementation guideline and should be removed.

🛠️ Proposed update
 	const saveAction = useCallback(
-		// FIXME
 		async (name: string, soundFile: any) => {
 			const soundData = createSoundData(soundFile, name);
 			const validation = validate(soundData, soundFile) as Array<Parameters<typeof t>[0]>;
 
 			validation.forEach((invalidFieldName) => {
 				throw new Error(t('Required_field', { field: t(invalidFieldName) }));
 			});
 
 			try {
 				const soundId = await insertOrUpdateSound(soundData);
 
 				if (!soundId) {
 					return undefined;
 				}
 
 				dispatchToastMessage({ type: 'success', message: t('Uploading_file') });
 
 				const reader = new FileReader();
 				reader.readAsBinaryString(soundFile);
 				reader.onloadend = (): void => {
 					try {
 						uploadCustomSound(reader.result as string, soundFile.type, {
 							...soundData,
 							_id: soundId,
 							random: Math.round(Math.random() * 1000),
 						});
 						dispatchToastMessage({ type: 'success', message: t('File_uploaded') });
 					} catch (error) {
 						(typeof error === 'string' || error instanceof Error) && dispatchToastMessage({ type: 'error', message: error });
 					}
 				};
 				close();
 				return soundId;
 			} catch (error) {
 				(typeof error === 'string' || error instanceof Error) && dispatchToastMessage({ type: 'error', message: error });
 			}
 		},
-		[dispatchToastMessage, insertOrUpdateSound, t, uploadCustomSound],
+		[close, dispatchToastMessage, insertOrUpdateSound, t, uploadCustomSound],
 	);
apps/meteor/client/views/admin/customSounds/EditSound.tsx (1)

54-96: ⚠️ Potential issue | 🟠 Major

Gate sidebar close behind successful save; early return on validation errors, and add close to dependencies.

close() currently executes unconditionally at line 94, closing the sidebar even when validation fails. Restructure with an early return on validation errors and add the missing close dependency to the hook. Remove the // FIXME comment per coding guidelines.

🛠️ Proposed update
	const saveAction = useCallback(
-		// FIXME
		async (sound: any) => {
			const soundData = createSoundData(sound, name, { previousName, previousSound, _id, extension: sound.extension });
			const validation = validate(soundData, sound);
-			if (validation.length === 0) {
-				let soundId: string;
-				try {
-					soundId = await insertOrUpdateSound(soundData);
-				} catch (error) {
-					dispatchToastMessage({ type: 'error', message: error });
-					return;
-				}
-
-				soundData._id = soundId;
-				soundData.random = Math.round(Math.random() * 1000);
-
-				if (sound && sound !== previousSound) {
-					dispatchToastMessage({ type: 'success', message: t('Uploading_file') });
-
-					const reader = new FileReader();
-					reader.readAsBinaryString(sound);
-					reader.onloadend = (): void => {
-						try {
-							uploadCustomSound(reader.result as string, sound.type, { ...soundData, _id: soundId });
-							return dispatchToastMessage({ type: 'success', message: t('File_uploaded') });
-						} catch (error) {
-							dispatchToastMessage({ type: 'error', message: error });
-						}
-					};
-				}
-			}
-
-			validation.forEach((invalidFieldName) =>
-				dispatchToastMessage({
-					type: 'error',
-					message: t('Required_field', { field: t(invalidFieldName) }),
-				}),
-			);
-
-			close();
+			if (validation.length > 0) {
+				validation.forEach((invalidFieldName) =>
+					dispatchToastMessage({
+						type: 'error',
+						message: t('Required_field', { field: t(invalidFieldName) }),
+					}),
+				);
+				return;
+			}
+
+			let soundId: string;
+			try {
+				soundId = await insertOrUpdateSound(soundData);
+			} catch (error) {
+				dispatchToastMessage({ type: 'error', message: error });
+				return;
+			}
+
+			soundData._id = soundId;
+			soundData.random = Math.round(Math.random() * 1000);
+
+			if (sound && sound !== previousSound) {
+				dispatchToastMessage({ type: 'success', message: t('Uploading_file') });
+
+				const reader = new FileReader();
+				reader.readAsBinaryString(sound);
+				reader.onloadend = (): void => {
+					try {
+						uploadCustomSound(reader.result as string, sound.type, { ...soundData, _id: soundId });
+						return dispatchToastMessage({ type: 'success', message: t('File_uploaded') });
+					} catch (error) {
+						dispatchToastMessage({ type: 'error', message: error });
+					}
+				};
+			}
+
+			close();
		},
-		[_id, dispatchToastMessage, insertOrUpdateSound, name, previousName, previousSound, t, uploadCustomSound],
+		[_id, close, dispatchToastMessage, insertOrUpdateSound, name, previousName, previousSound, t, uploadCustomSound],
	);

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 18.64407% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.34%. Comparing base (248e4fa) to head (f92ff82).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38442      +/-   ##
===========================================
- Coverage    70.41%   70.34%   -0.07%     
===========================================
  Files         3162     3162              
  Lines       110663   110705      +42     
  Branches     19940    19869      -71     
===========================================
- Hits         77923    77880      -43     
- Misses       30711    30803      +92     
+ Partials      2029     2022       -7     
Flag Coverage Δ
e2e 60.37% <ø> (-0.04%) ⬇️
e2e-api 48.75% <43.47%> (-0.07%) ⬇️
unit 71.30% <2.77%> (-0.09%) ⬇️

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

📦 Docker Image Size Report

➡️ Changes

Service Current Baseline Change Percent
sum of all images 0B 0B 0B
account-service 0B 0B 0B
authorization-service 0B 0B 0B
ddp-streamer-service 0B 0B 0B
omnichannel-transcript-service 0B 0B 0B
presence-service 0B 0B 0B
queue-worker-service 0B 0B 0B
rocketchat 0B 0B 0B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "02/10 20:06 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.00]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "queue-worker-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "rocketchat" [0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.00]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 0B
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-38442
  • Baseline: develop
  • Timestamp: 2026-02-10 20:06:02 UTC
  • Historical data points: 30

Updated: Tue, 10 Feb 2026 20:06:03 GMT

@kody-ai
Copy link

kody-ai bot commented Feb 2, 2026

Your trial has ended! 😢

To keep getting reviews, activate your plan here.

Got questions about plans or want to see if we can extend your trial? Talk to our founders here.😎

@nazabucciarelli
Copy link
Contributor Author

nazabucciarelli commented Feb 2, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/client/views/admin/customSounds/EditCustomSound.tsx (1)

19-29: ⚠️ Potential issue | 🟡 Minor

Guard the query when _id is undefined to prevent unfiltered results during routing transitions.

Although EditCustomSound is only rendered when context === 'edit', the id route parameter from useRouteParameter('id') can be undefined if the route is accessed directly without the parameter or during routing transitions. This causes getSounds({ _id: undefined }) to execute, which may return all sounds instead of filtering. Add enabled: Boolean(_id) to gate the query and include a defensive check in queryFn.

♻️ Suggested guard
 const { data, isPending } = useQuery({
   queryKey: ['custom-sounds', _id],
+  enabled: Boolean(_id),
   queryFn: async () => {
+    if (!_id) {
+      throw new Error(t('No_results_found'));
+    }
     const { sounds } = await getSounds({ _id });
🧹 Nitpick comments (1)
apps/meteor/app/api/server/v1/custom-sounds.ts (1)

58-61: Optional: keep the response schema tight unless you plan to return top‑level _id.
Since the response body doesn’t currently include a top‑level _id, consider dropping it from the schema (or add it to the response) to avoid confusing API consumers.

♻️ Remove top‑level `_id` from response schema (if not intended)
-					_id: {
-						type: 'string',
-						description: 'The ID of the sound.',
-					},

@nazabucciarelli
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nazabucciarelli nazabucciarelli marked this pull request as ready for review February 2, 2026 16:16
@nazabucciarelli nazabucciarelli requested review from a team as code owners February 2, 2026 16:16
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/client/views/admin/customSounds/EditSound.tsx (1)

54-96: ⚠️ Potential issue | 🟠 Major

Missing close in saveAction dependency array.

The close function is called at line 85 but is not included in the dependency array at line 95. This can cause stale closure issues where an outdated close reference is captured.

🐛 Proposed fix
-		[_id, dispatchToastMessage, insertOrUpdateSound, name, previousName, previousSound, t, uploadCustomSound],
+		[_id, close, dispatchToastMessage, insertOrUpdateSound, name, previousName, previousSound, t, uploadCustomSound],
🤖 Fix all issues with AI agents
In `@apps/meteor/tests/end-to-end/api/custom-sounds.ts`:
- Around line 130-146: The test description string for the case inside the test
block (the it(...) call in apps/meteor/tests/end-to-end/api/custom-sounds.ts)
contains a typo ("requestes"); update that string to "requested" so it reads
"should return the requested custom sound when using the `_id` parameter". Only
change the human-readable test description in the it(...) call — do not modify
assertions, variable names like fileId, or the request flow.
🧹 Nitpick comments (1)
apps/meteor/client/views/admin/customSounds/EditSound.tsx (1)

112-112: Optional chaining is now unnecessary.

Since close is now a required prop (line 12), the optional chaining close?.() can be simplified to close() for consistency with the usage at line 85 and line 153.

♻️ Proposed fix
-				close?.();
+				close();

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.

1 issue found across 6 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/meteor/tests/end-to-end/api/custom-sounds.ts">

<violation number="1" location="apps/meteor/tests/end-to-end/api/custom-sounds.ts:130">
P3: Typo in test description: "requestes" should be "requested".</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@nazabucciarelli nazabucciarelli added this to the 8.2.0 milestone Feb 2, 2026
Copy link
Contributor

@aleksandernsilva aleksandernsilva left a comment

Choose a reason for hiding this comment

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

LGTM

PS.: There's definitely an opportunity to improve the UX and code style for this flow, but it is outside the scope of this PR.

@nazabucciarelli nazabucciarelli changed the title fix: sidebar state and refresh behavior on custom sounds fix: ContextualBar state and refresh behavior on custom sounds Feb 3, 2026
Co-authored-by: Júlia Jaeger Foresti <60678893+juliajforesti@users.noreply.github.com>
juliajforesti
juliajforesti previously approved these changes Feb 3, 2026
@aleksandernsilva aleksandernsilva added the stat: QA assured Means it has been tested and approved by a company insider label Feb 4, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Feb 4, 2026
ricardogarim
ricardogarim previously approved these changes Feb 10, 2026
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Feb 10, 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/tests/end-to-end/api/custom-sounds.ts (1)

66-78: ⚠️ Potential issue | 🟡 Minor

fileId2 is never cleaned up in the after hook.

The after block only deletes fileId, leaving the second custom sound (fileId2) orphaned after the test suite runs. Consider deleting both.

Proposed fix
 	after(() =>
-		request
+		Promise.all([request
 			.post(api('method.call/deleteCustomSound'))
 			.set(credentials)
 			.send({
 				message: JSON.stringify({
 					msg: 'method',
 					id: '33',
 					method: 'deleteCustomSound',
 					params: [fileId],
 				}),
-			}),
+			}),
+		request
+			.post(api('method.call/deleteCustomSound'))
+			.set(credentials)
+			.send({
+				message: JSON.stringify({
+					msg: 'method',
+					id: '34',
+					method: 'deleteCustomSound',
+					params: [fileId2],
+				}),
+			}),
+		]),
 	);
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efcba58 and f92ff82.

📒 Files selected for processing (1)
  • apps/meteor/tests/end-to-end/api/custom-sounds.ts
🧰 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/tests/end-to-end/api/custom-sounds.ts
🧠 Learnings (18)
📚 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 : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/tests/end-to-end/api/custom-sounds.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/custom-sounds.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/custom-sounds.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/custom-sounds.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:

  • apps/meteor/tests/end-to-end/api/custom-sounds.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/custom-sounds.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/custom-sounds.ts
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.

Applied to files:

  • apps/meteor/tests/end-to-end/api/custom-sounds.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 **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/custom-sounds.ts
📚 Learning: 2026-01-16T22:56:30.299Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 38224
File: apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx:15-20
Timestamp: 2026-01-16T22:56:30.299Z
Learning: For the logs documentation link in apps/meteor/client/lib/links.ts, the correct URL slug is `/i/logs-docs` (plural), not `/i/logs-doc` (singular).

Applied to files:

  • apps/meteor/tests/end-to-end/api/custom-sounds.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/custom-sounds.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/custom-sounds.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/custom-sounds.ts
📚 Learning: 2025-12-16T17:29:45.163Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37834
File: apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-emoji.ts:12-22
Timestamp: 2025-12-16T17:29:45.163Z
Learning: In page object files under `apps/meteor/tests/e2e/page-objects/`, always import `expect` from `../../utils/test` (Playwright's async expect), not from Jest. Jest's `expect` has a synchronous signature and will cause TypeScript errors when used with web-first assertions like `toBeVisible()`.

Applied to files:

  • apps/meteor/tests/end-to-end/api/custom-sounds.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/custom-sounds.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/custom-sounds.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/custom-sounds.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/custom-sounds.ts
🧬 Code graph analysis (1)
apps/meteor/tests/end-to-end/api/custom-sounds.ts (1)
packages/core-services/src/index.ts (1)
  • api (55-55)
⏰ 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 comments (1)
apps/meteor/tests/end-to-end/api/custom-sounds.ts (1)

130-144: Clean test — LGTM on logic and assertions.

The new test correctly verifies the _id query parameter, uses async/await (preferable to the done callback pattern), and has appropriate assertions. The past typo has been fixed.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@KevLehman KevLehman added the stat: ready to merge PR tested and approved waiting for merge label Feb 10, 2026
@kodiakhq kodiakhq bot merged commit 1c153bf into develop Feb 10, 2026
46 checks passed
@kodiakhq kodiakhq bot deleted the fix/custom-sounds-bug branch February 10, 2026 21:20
@ggazzo
Copy link
Member

ggazzo commented Feb 11, 2026

when a PR fixes something but changes an API, a changeset for that API should be created.

not 100% sure about a list being filtered by a single id

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.

6 participants