Skip to content

Conversation

@juliajforesti
Copy link
Contributor

@juliajforesti juliajforesti commented Nov 6, 2025

ARCH-1869

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores

    • Removed the deprecated livechat custom field method. Applications must migrate to the REST API endpoint for custom field operations.
  • Tests

    • Updated test data to use the REST API endpoint for livechat custom fields.

@juliajforesti juliajforesti added this to the 8.0.0 milestone Nov 6, 2025
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 6, 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 Nov 6, 2025

🦋 Changeset detected

Latest commit: ff2618d

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 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/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 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 Nov 6, 2025

Walkthrough

This PR removes the deprecated livechat:saveCustomField Meteor method by deleting its implementation file, removing its import, and migrating test code to use the replacement REST API endpoint /livechat/custom-fields/save.

Changes

Cohort / File(s) Summary
Changeset & Build Configuration
.changeset/twenty-cars-decide.md
Documents major version bump for @rocket.chat/meteor and declares removal of livechat:saveCustomField method.
Module Imports
apps/meteor/app/livechat/server/index.ts
Removed import of the deprecated ./methods/saveCustomField module, preventing its initialization.
Deprecated Method Removal
apps/meteor/app/livechat/server/methods/saveCustomField.ts
Deleted entire server method implementation, including Meteor.methods registration, permission checks, field validation, and database interactions for livechat:saveCustomField.
Test Data Migration
apps/meteor/tests/data/livechat/custom-fields.ts
Replaced RPC-style method call with REST API POST request to /livechat/custom-fields/save, updated payload structure from customFieldData envelope to { customFieldId, customFieldData }, and removed obsolete methodCall import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward removal of deprecated code with clear migration path
  • Changes are homogeneous and follow a consistent pattern (removal + REST migration)
  • Low complexity—no intricate logic or behavioral modifications
  • Areas to verify:
    • Confirm no other codebase references to the removed livechat:saveCustomField method remain
    • Validate the REST endpoint /livechat/custom-fields/save exists and handles the new payload structure correctly
    • Ensure test data migration is comprehensive and covers all use cases

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo
  • tassoevan
  • sampaiodiego

Poem

🐰 A method once lived, now deprecated past,
We bid it farewell, the die has been cast!
REST endpoints gleam in the code's bright new light,
One fewer RPC—the future burns bright!

Pre-merge checks and finishing touches

✅ 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 accurately describes the main change: removing the deprecated livechat:saveCustomField method, matching the changeset and code modifications.
Linked Issues check ✅ Passed All code changes directly fulfill ARCH-1869: the deprecated livechat:saveCustomField method has been removed from the codebase, including its implementation, imports, and test references.
Out of Scope Changes check ✅ Passed All changes are in scope—the removal of the deprecated method, its imports, and test updates align with the stated objective of removing livechat:saveCustomField.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/remove-saveCustomField

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.

@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

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

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-8.0.0   #37421      +/-   ##
=================================================
+ Coverage          70.50%   70.93%   +0.43%     
=================================================
  Files               2870     3035     +165     
  Lines             102098   104621    +2523     
  Branches           17589    18422     +833     
=================================================
+ Hits               71984    74218    +2234     
- Misses             28356    28457     +101     
- Partials            1758     1946     +188     
Flag Coverage Δ
e2e 58.07% <ø> (+1.34%) ⬆️
unit 72.29% <ø> (+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.

@juliajforesti juliajforesti force-pushed the chore/remove-saveCustomField branch from 4ce3847 to ff2618d Compare November 7, 2025 14:43
@juliajforesti juliajforesti marked this pull request as ready for review November 7, 2025 17:56
@juliajforesti juliajforesti requested a review from a team as a code owner November 7, 2025 17:56
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 (1)
apps/meteor/tests/data/livechat/custom-fields.ts (1)

25-27: Optional: Address Biome void return type warning.

Biome flags return reject(err) because the function returns void. While this pattern is idiomatic in Promise code, you can make it stricter by separating the call from the return.

Apply this diff if you want to comply with Biome's stricter rules:

 			.end((err: Error, res: Response): void => {
 				if (err) {
-					return reject(err);
+					reject(err);
+					return;
 				}
 				resolve(res.body.customField);
 			});

Note: The same pattern appears on lines 16 and 44 and could be updated for consistency.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d1adf9e and ff2618d.

📒 Files selected for processing (4)
  • .changeset/twenty-cars-decide.md (1 hunks)
  • apps/meteor/app/livechat/server/index.ts (0 hunks)
  • apps/meteor/app/livechat/server/methods/saveCustomField.ts (0 hunks)
  • apps/meteor/tests/data/livechat/custom-fields.ts (2 hunks)
💤 Files with no reviewable changes (2)
  • apps/meteor/app/livechat/server/methods/saveCustomField.ts
  • apps/meteor/app/livechat/server/index.ts
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • .changeset/twenty-cars-decide.md
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx} : Avoid code comments in the implementation

Applied to files:

  • apps/meteor/tests/data/livechat/custom-fields.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/data/livechat/custom-fields.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx} : Write concise, technical TypeScript/JavaScript with accurate typing

Applied to files:

  • apps/meteor/tests/data/livechat/custom-fields.ts
🧬 Code graph analysis (1)
apps/meteor/tests/data/livechat/custom-fields.ts (1)
apps/meteor/tests/data/api-data.ts (1)
  • credentials (39-42)
🪛 Biome (2.1.2)
apps/meteor/tests/data/livechat/custom-fields.ts

[error] 27-27: The function should not return a value because its return type is void.

The function is here:

'void' signals the absence of value. The returned value is likely to be ignored by the caller.

(lint/correctness/noVoidTypeReturn)

🔇 Additional comments (3)
.changeset/twenty-cars-decide.md (1)

1-5: LGTM! Changeset correctly documents breaking change.

The changeset properly declares a major version bump for removing the deprecated livechat:saveCustomField method, which is appropriate for a breaking API change.

apps/meteor/tests/data/livechat/custom-fields.ts (2)

4-4: LGTM! Correctly removed unused import.

The methodCall import is no longer needed after migrating to the REST API endpoint.


22-29: Migration to REST endpoint is complete and correct.

Verification confirms no remaining references to the deprecated livechat:saveCustomField Meteor method exist in the codebase. The endpoint migration is consistent across both the test file and client implementation (EditCustomFields.tsx), with proper payload structure and response handling aligned to the REST API pattern.

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Nov 7, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 7, 2025
@ggazzo ggazzo merged commit c9ba7b9 into release-8.0.0 Nov 7, 2025
130 of 136 checks passed
@ggazzo ggazzo deleted the chore/remove-saveCustomField branch November 7, 2025 20:47
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