fix: slash command params silently truncated at first line break#41325
fix: slash command params silently truncated at first line break#41325dsaicharan072-cmyk wants to merge 1 commit into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 4adc251 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThe client slash-command parser now preserves parameters across newline characters. Tests verify single-line, multiline, and quoted multiline payloads, and a patch changeset documents the fix. ChangesMultiline slash command parsing
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
The client-side parse() helper in processSlashCommand.ts used the regex /^\/([^\s]+)(.*)/ without the dotall flag. Because (.*) stops at \n by default, any text typed after a Shift+Enter in the composer was silently dropped before it reached the command handler. Fix: add the /s (dotall) flag so (.*) matches across newlines. The server-side parser (apps/meteor/lib/utils/parseParameters.ts) already handles multi-line params correctly; this change makes the client-side path consistent with it. Closes: RocketChat#41324
3f0bb58 to
4adc251
Compare
The client-side parse() helper in processSlashCommand.ts used the regex /^/([^\s]+)(.)/ without the dotall flag. Because (.) stops at \n by default, any text typed after a Shift+Enter in the composer was silently dropped before it reached the command handler.
Fix: add the /s (dotall) flag so (.*) matches across newlines.
The server-side parser (apps/meteor/lib/utils/parseParameters.ts) already handles multi-line params correctly; this change makes the client-side path consistent with it.
Closes: #41324
Summary by CodeRabbit
Bug Fixes
Tests