-
Notifications
You must be signed in to change notification settings - Fork 13k
chore!: remove deprecated removeCannedResponse method
#37446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 0d010aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
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 |
WalkthroughThis PR completes the deprecation cycle by removing the public DDP-method exposure and ServerMethods augmentation for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-8.0.0 #37446 +/- ##
=================================================
- Coverage 70.50% 70.50% -0.01%
=================================================
Files 2870 2870
Lines 102098 102096 -2
Branches 17589 17587 -2
=================================================
- Hits 71984 71982 -2
- Misses 28356 28357 +1
+ Partials 1758 1757 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
📜 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.
📒 Files selected for processing (2)
.changeset/smooth-birds-crash.md(1 hunks)apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts(0 hunks)
💤 Files with no reviewable changes (1)
- apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts
🔇 Additional comments (1)
.changeset/smooth-birds-crash.md (1)
1-5: Changeset metadata structure and versioning are correct.The major version bump is semantically appropriate for removing a public API method, which is a breaking change. The description clearly communicates the deprecation removal.
| --- | ||
| '@rocket.chat/meteor': major | ||
| --- | ||
|
|
||
| Removes deprecated `removeCannedResponse` method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify actual implementation changes to confirm deprecation removal was completed.
This changeset file appears valid, but I can only review the metadata. To ensure the PR objectives are fully met, please confirm:
- The DDP-method exposure (Meteor.methods wrapper) for
removeCannedResponsewas actually removed. - The public ServerMethods augmentation in the ddp-client module was removed.
- The internal
removeCannedResponsefunction implementation remains intact. - No orphaned imports or deprecation logger references remain.
- No references to the removed public API remain in other files.
The related TypeScript files mentioned in the summary (e.g., apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts) were not provided in this review, so I cannot directly verify these changes.
🏁 Script executed:
#!/bin/bash
# Verify that removeCannedResponse was properly removed from public API
# Check 1: Search for any remaining Meteor.methods references to removeCannedResponse
echo "=== Checking for remaining Meteor.methods references ==="
rg -nA 3 "removeCannedResponse" apps/meteor/ee/app/canned-responses/ --type ts
# Check 2: Search for ServerMethods augmentation references
echo "=== Checking for ServerMethods augmentation ==="
rg -nA 2 "ServerMethods.*removeCannedResponse|removeCannedResponse.*ServerMethods" --type ts
# Check 3: Verify internal function still exists
echo "=== Verifying internal removeCannedResponse function exists ==="
rg -nB 2 -A 5 "export.*function.*removeCannedResponse|export async function removeCannedResponse" apps/meteor/ee/app/canned-responses/ --type tsLength of output: 1639
🏁 Script executed:
#!/bin/bash
# More comprehensive verification of removeCannedResponse removal
# Check 1: Search for Meteor.methods registration across entire codebase
echo "=== Checking for Meteor.methods registration ==="
rg -n "Meteor\.methods\s*\(" --type ts --type js -A 15 | grep -C 5 -i "removeCannedResponse" || echo "No Meteor.methods with removeCannedResponse found"
# Check 2: Search for all imports of removeCannedResponse
echo ""
echo "=== Checking for imports of removeCannedResponse ==="
rg -n "import.*removeCannedResponse|from.*removeCannedResponse" --type ts --type js
# Check 3: Search in ddp-client for ServerMethods augmentation
echo ""
echo "=== Checking ddp-client for ServerMethods type ==="
fd -e ts -e tsx -path "*ddp-client*" | head -20
# Check 4: Look for ServerMethods interface/type definition
echo ""
echo "=== Searching for ServerMethods interface definition ==="
rg -n "interface ServerMethods|type ServerMethods" --type ts -A 20 | head -50
# Check 5: Check if removeCannedResponse is registered anywhere else
echo ""
echo "=== Broader search for removeCannedResponse registration patterns ==="
rg -n "removeCannedResponse.*:" --type ts --type js -C 2 | head -40Length of output: 6282
🏁 Script executed:
#!/bin/bash
# Verify actual usage and REST API removal
# Check 1: See how removeCannedResponse is used in api-enterprise
echo "=== Usage in api-enterprise/server/canned-responses.ts ==="
cat apps/meteor/ee/app/api-enterprise/server/canned-responses.ts | head -100
# Check 2: Search for REST route handlers for canned-responses
echo ""
echo "=== Searching for REST routes for canned-responses ==="
rg -n "DELETE.*canned-responses|/v1/canned-responses" --type ts -B 3 -A 3
# Check 3: Check if there's a deprecation wrapper or if the method was actually removed from public use
echo ""
echo "=== Checking for any deprecation decorators or comments ==="
rg -n "deprecated|Deprecated|DEPRECATED" apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts -B 2 -A 2
# Check 4: Verify imports in removeCannedResponse.ts file
echo ""
echo "=== Complete removeCannedResponse.ts file ==="
cat apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.tsLength of output: 17085
🏁 Script executed:
#!/bin/bash
# Find where removeCannedResponse is actually called in route handlers
echo "=== Full DELETE route handler implementation for canned-responses/:_id ==="
sed -n '166,200p' apps/meteor/ee/app/api-enterprise/server/canned-responses.ts
echo ""
echo "=== Search for removeCannedResponse calls in the file ==="
grep -n "removeCannedResponse" apps/meteor/ee/app/api-enterprise/server/canned-responses.ts
echo ""
echo "=== Full route handler for DELETE canned-responses (deprecated) ==="
sed -n '106,160p' apps/meteor/ee/app/api-enterprise/server/canned-responses.tsLength of output: 2501
Changeset message is incorrect—removeCannedResponse function was not removed and remains actively used.
The changeset claims "Removes deprecated removeCannedResponse method," but verification shows:
- The
removeCannedResponsefunction still exists inapps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.tsand remains exported - The function is actively called in two REST route handlers in
apps/meteor/ee/app/api-enterprise/server/canned-responses.ts:- Line 159: DELETE
/v1/canned-responses/:_id - Line 188: DELETE
/v1/canned-responses(deprecated)
- Line 159: DELETE
- The function has no deprecation decorator or logger (unlike
saveCannedResponse) - No Meteor.methods registration ever existed for this function
Either update the changeset message to reflect the actual changes, or complete the removal by:
- Replacing both route handlers to use an alternative implementation
- Removing the import and function file
- Adding deprecation logging if maintaining backward compatibility
ARCH-1872
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
removeCannedResponsefrom the public API. Applications using this method will require updates for compatibility with this major version.