Skip to content

Conversation

@yash-rajpal
Copy link
Member

@yash-rajpal yash-rajpal commented Oct 22, 2025

Proposed changes (including videos or screenshots)

When updating a canned response, we were not properly persisting userId when editing a canned response, due to which we were unsetting the userId field. This was causing weird issues on client side when viewing the list of canned responses.

Issue(s)

Steps to test or reproduce

  • Create a private canned response, of scope user
  • Update the canned response
  • Updated canned response has no userId

Further comments

SUP-855

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where updates to private canned responses were not properly displayed in the canned-response contextual bar.
    • Improved data persistence when updating canned responses to ensure user information is correctly retained.

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

🦋 Changeset detected

Latest commit: 784c8e8

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

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch 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/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/stream-hub-service 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/ui-voip 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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 22, 2025

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

  • This PR is targeting the wrong base branch. It should target 7.13.0, but it targets 7.12.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

A patch-level fix for private canned responses adds conditional userId inclusion when updating user-scoped entries. Changes include modifying the update payload in saveCannedResponse, adding a test to verify userId persistence, and documenting the fix in a changeset entry.

Changes

Cohort / File(s) Summary
Release Documentation
.changeset/long-melons-float.md
Patch changeset entry for @rocket.chat/meteor documenting a fix for displaying updates to private canned responses in the contextual bar
Server Method
apps/meteor/ee/app/canned-responses/server/methods/saveCannedResponse.ts
Extended payload sent to CannedResponse.updateCannedResponse to conditionally include userId when the existing canned response has user scope
End-to-End Tests
apps/meteor/tests/end-to-end/api/livechat/15-canned-responses.ts
Added import of adminUsername and new test case verifying that userId persists when updating a user-scoped canned response

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

stat: ready to merge

Suggested reviewers

  • dougfabris
  • tassoevan

Poem

🐰 A canned response hops with care,
When user scope needs to stay there,
With userId preserved just right,
Private messages see the light! ✨

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 “fix: Persist userId when updating a canned response” clearly and concisely describes the core change by focusing on the persisted userId behavior during canned response updates, matching the modifications in saveCannedResponse.ts and the new test case. It uses conventional commit style, avoids unnecessary detail, and accurately reflects the main purpose of the PR.
Linked Issues Check ✅ Passed The pull request directly addresses SUP-855 by modifying saveCannedResponse to include userId when updating a user-scoped canned response and adding an end-to-end test that verifies the userId persists after update, thereby meeting the linked issue’s requirement.
Out of Scope Changes Check ✅ Passed All changes—including the changeset file update, saveCannedResponse.ts modification, and related test adjustments—are directly related to persisting userId on canned response updates, with no unrelated or extraneous modifications present.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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 fix/editing-canned-responses

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.

@yash-rajpal yash-rajpal added the stat: QA assured Means it has been tested and approved by a company insider label Oct 22, 2025
@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.58%. Comparing base (9828d5c) to head (784c8e8).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37277      +/-   ##
===========================================
- Coverage    67.61%   67.58%   -0.03%     
===========================================
  Files         3338     3338              
  Lines       113721   113721              
  Branches     20662    20654       -8     
===========================================
- Hits         76895    76864      -31     
- Misses       34143    34173      +30     
- Partials      2683     2684       +1     
Flag Coverage Δ
e2e 57.39% <ø> (-0.01%) ⬇️
unit 71.56% <ø> (-0.05%) ⬇️

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.

@yash-rajpal yash-rajpal marked this pull request as ready for review October 22, 2025 20:11
@yash-rajpal yash-rajpal requested review from a team as code owners October 22, 2025 20:11
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: 2

📜 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 01aa489 and ca8be50.

📒 Files selected for processing (3)
  • .changeset/long-melons-float.md (1 hunks)
  • apps/meteor/ee/app/canned-responses/server/methods/saveCannedResponse.ts (1 hunks)
  • apps/meteor/tests/end-to-end/api/livechat/15-canned-responses.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/tests/end-to-end/api/livechat/15-canned-responses.ts (1)
apps/meteor/tests/data/api-data.ts (2)
  • request (10-10)
  • credentials (39-42)

@scuciatto scuciatto added this to the 7.13.0 milestone Oct 27, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 27, 2025
@kodiakhq kodiakhq bot merged commit b71f838 into develop Oct 27, 2025
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/editing-canned-responses branch October 27, 2025 10:09
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