fix: encoding of special characters in text attachments by cardoso · Pull Request #35863 · RocketChat/Rocket.Chat · GitHub
Skip to content

fix: encoding of special characters in text attachments - #35863

Merged
kodiakhq[bot] merged 31 commits into
developfrom
SUP-725-api-txt-attachment-enc
Jun 16, 2025
Merged

kodiakhq[bot] merged 31 commits into
developfrom
SUP-725-api-txt-attachment-enc

Conversation

@cardoso

@cardoso cardoso commented Apr 23, 2025 •

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

This PR fixes an issue when posting messages via the API: special characters like > < and & symbol in code blocks inside text attachments are displayed as &gt; , &lt;, and &amp;.

Issue(s)

https://rocketchat.atlassian.net/browse/SUP-725

Steps to test or reproduce

API Endpoint: /api/v1/chat.postMessage

Example API Body:

{
  "channel": "#COMM_EMOJI_TEST",
  "text": "```text\n TEST > TEST \n```",
   "attachments": [{ "text": "```text\n TEST > TEST\n```" }]
}

Result: The > symbol becomes &gt; in the attachment text but not in the message body.

image-20250110-165501

Further comments


Pull Request Description:

This pull request addresses an issue in the Rocket.Chat repository related to the encoding of special characters in attachments. The changes are made in the DefaultAttachment.tsx file within the apps/meteor/client/components/message/content/attachments directory. The update introduces the use of the Markup component from the gazzodown library to handle markdown content in attachments. Additionally, it implements conditional rendering based on the presence of the md property to ensure proper encoding and display of special characters. The source branch for this fix is SUP-725-api-txt-attachment-enc, and it targets the develop branch.

@dionisio-bot

dionisio-bot Bot commented Apr 23, 2025 •

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-bot Bot commented Apr 23, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 80cf64c

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

This PR includes changesets to release 36 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/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts 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/license 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/mock-providers Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status 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

@kody-ai

kody-ai Bot commented Apr 23, 2025 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@github-actions

github-actions Bot commented Apr 23, 2025 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.1

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35863/

Built to branch gh-pages at 2025-06-15 14:56 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov

codecov Bot commented Apr 23, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.44%. Comparing base (66bfab9) to head (80cf64c).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #35863   +/-   ##
========================================
  Coverage    64.44%   64.44%           
========================================
  Files         3138     3138           
  Lines       104909   104920   +11     
  Branches     19779    19781    +2     
========================================
+ Hits         67606    67617   +11     
+ Misses       34621    34617    -4     
- Partials      2682     2686    +4     
Flag Coverage Δ
e2e 57.67% <62.50%> (+0.03%) ⬆️
unit 69.02% <100.00%> (-0.02%) ⬇️

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.

@cardoso cardoso changed the title fix: encoding of special characters in attachments fix: encoding of special characters in text attachments Apr 23, 2025
@kody-ai

kody-ai Bot commented Apr 24, 2025 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@cardoso cardoso added this to the 7.7.0 milestone Apr 24, 2025
@kody-ai

kody-ai Bot commented Apr 24, 2025 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

Comment thread apps/meteor/client/components/MarkdownText.tsx Outdated
Comment thread apps/meteor/client/components/MarkdownText.spec.tsx Outdated
@kody-ai

kody-ai Bot commented Apr 25, 2025 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@kody-ai

kody-ai Bot commented Apr 25, 2025 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@cardoso
cardoso marked this pull request as ready for review April 28, 2025 13:26
@cardoso
cardoso requested a review from a team as a code owner April 28, 2025 13:26
@kody-ai

kody-ai Bot commented Apr 28, 2025 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@kody-ai

kody-ai Bot commented Apr 28, 2025 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@kody-ai

kody-ai Bot commented Apr 29, 2025 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@kody-ai

kody-ai Bot commented May 2, 2025 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security ✅
Code Style ✅
Kody Rules ✅
Refactoring ✅
Error Handling ✅
Maintainability ✅
Potential Issues ✅
Documentation And Comments ✅
Performance And Optimization ✅
Breaking Changes ❌

Access your configuration settings here.

​

@cardoso
cardoso force-pushed the SUP-725-api-txt-attachment-enc branch from 19e3289 to e2e5fc4 Compare May 21, 2025 19:05
@cardoso
cardoso requested a review from ggazzo May 21, 2025 19:13
@cardoso
cardoso dismissed stale reviews from ggazzo and gabriellsh May 21, 2025 21:31

changes made

@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Jun 12, 2025
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 12, 2025
@kodiakhq
kodiakhq Bot merged commit b1d3fff into develop Jun 16, 2025
@kodiakhq
kodiakhq Bot deleted the SUP-725-api-txt-attachment-enc branch June 16, 2025 12:14
This was referenced Jun 20, 2025
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.

5 participants