Skip to content

refactor: Remove unused description from attachments render#40067

Merged
ggazzo merged 9 commits intodevelopfrom
refactor/remove-descriptionMd
Apr 10, 2026
Merged

refactor: Remove unused description from attachments render#40067
ggazzo merged 9 commits intodevelopfrom
refactor/remove-descriptionMd

Conversation

@dougfabris
Copy link
Copy Markdown
Member

@dougfabris dougfabris commented Apr 7, 2026

Proposed changes (including videos or screenshots)

Summary

  • Remove descriptionMd field from MessageAttachmentBase type
  • Remove descriptionMd parsing from BeforeSaveMarkdownParser and parseMessageTextToAstMarkdown
  • Remove visible description rendering from all file attachment components (Image, Audio, Video, Generic)
  • Remove descriptionMd fallbacks from copy/report message actions
  • Clean up related tests

The descriptionMd field was a parsed markdown AST of the attachment description, rendered as text above file attachments. This is no longer needed as description is being repurposed exclusively for image alt text.

Test plan

  • Upload an image — verify no description text renders above the image
  • Upload audio/video/generic files — verify no regressions
  • Copy and report message actions still work on file messages

Issue(s)

Steps to test or reproduce

Further comments

WA-17

Summary by CodeRabbit

  • Changes
    • Attachment descriptions no longer display in audio, video, image, and generic file previews, exported PDFs, email notifications, transcripts, and exported attachment payloads.
    • Copy/report fallbacks, message editing, previews, thread titles, decrypted-message display, and normalized previews now prefer attachment titles or message text instead of descriptions.
    • Auto-translation and translation providers no longer send or derive from attachment descriptions.
    • Public typing: descriptionMd removed; tests updated.

…dering

The `descriptionMd` field was a parsed markdown AST version of the attachment
description, rendered as visible text above file attachments. This is no longer
needed as `description` is being repurposed for image alt text instead of
visible message content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Apr 7, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Removed parsing, rendering, mapping, and typings for attachment description/descriptionMd across UI, server, translation, and export code; logic now prefers title, text, or message.msg depending on context.

Changes

Cohort / File(s) Summary
Attachment components
apps/meteor/client/components/message/content/attachments/file/AudioAttachment.tsx, apps/meteor/client/components/message/content/attachments/file/GenericFileAttachment.tsx, apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx, apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx
Removed props/imports and conditional rendering for description / descriptionMd; components now render only media preview/collapsible content (no description/markdown body).
Toolbar & message actions
apps/meteor/client/components/message/toolbar/useCopyAction.ts, apps/meteor/client/components/message/toolbar/useReportMessageAction.tsx
Fallback text sourcing changed to prefer attachments[0].title (or message.msg); removed use of attachments[0].description/descriptionMd for copy/report payloads.
Message editing & body selection
apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx, apps/meteor/app/ui/client/lib/ChatMessages.ts
Editing and message-body selection now prefer message.msg or an attachment title; fallbacks to attachment description were removed.
Normalization & previews
apps/meteor/client/lib/normalizeThreadMessage.tsx, apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts, apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
Preview/normalize logic now selects first attachment with a title and returns escaped title; tests updated accordingly (removed description-based expectations).
Parsing & markdown hooks/server
apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts, apps/meteor/server/services/messages/hooks/BeforeSaveMarkdownParser.ts, apps/meteor/tests/unit/server/services/messages/hooks/BeforeSaveMarkdownParser.tests.ts
Removed parsing/population of attachment.descriptiondescriptionMd; parsing pipeline now relies on attachment.text/md and no longer mutates file attachment description markdown.
Auto-translate & translators
apps/meteor/app/autotranslate/client/lib/autotranslate.ts, apps/meteor/app/autotranslate/server/autotranslate.ts, apps/meteor/app/autotranslate/server/deeplTranslate.ts, apps/meteor/app/autotranslate/server/googleTranslate.ts, apps/meteor/app/autotranslate/server/msTranslate.ts
Attachment translation uses only attachment.text for translation input and translations.original; description is no longer sent to translation APIs or used to populate originals.
Server conversions & typings
apps/meteor/app/apps/server/converters/messages.js, packages/core-typings/src/IMessage/MessageAttachment/MessageAttachmentBase.ts
Removed descriptionMd from core attachment typings; storage→App converter no longer maps description into App-facing attachments.
Notifications, emails & exports
apps/meteor/app/lib/server/functions/notifications/email.js, apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts, apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts, apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts, apps/meteor/client/views/room/contextualBar/ExportMessages/useExportMessagesAsPDFMutation.tsx
Email/notification/export flows no longer include or convert attachment.description; bodies and exported PDFs now omit attachment descriptions and use message.msg or title where applicable.
Message update, transcripts & integrations
apps/meteor/app/lib/server/methods/updateMessage.ts, apps/meteor/app/livechat/server/lib/sendTranscript.ts, ee/packages/omnichannel-services/src/OmnichannelTranscript.ts, apps/meteor/app/slackbridge/server/RocketAdapter.ts
Removed logic that patched or fell back to attachments[0].description during update, transcript generation, Slack sharing, and export processing; text now relies on message.msg or title.
Hooks & decryption tests
apps/meteor/client/hooks/useDecryptedMessage.ts, apps/meteor/client/hooks/useDecryptedMessage.spec.ts
Post-decryption behavior now sets generic Message_with_attachment when attachments are present; tests updated to stop expecting decrypted attachment description.
Tests & fixtures
apps/meteor/tests/unit/server/services/messages/hooks/BeforeSaveJumpToMessage.tests.ts, apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts, apps/meteor/tests/end-to-end/api/rooms.ts
Removed descriptionMd from fixtures, updated/removed tests that expected description-based parsing or propagation, and added an assertion ensuring legacy flows don't surface attachment description as message.msg.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The PR removes description rendering to repurpose description as alt text, which partially addresses WA-17's goal of adding alt text for images. Verify that the PR also implements the alternative text input field, persistence, and assistive technology exposure required by WA-17 acceptance criteria.
Out of Scope Changes check ❓ Inconclusive Changes comprehensively remove description rendering across components and utilities, with some cleanups extending beyond description removal alone. Confirm that updates to translation, notification, email, and other services are necessary for the description removal, rather than unrelated refactoring.
✅ Passed checks (2 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 objective: removing unused description rendering from attachment components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

⚠️ No Changeset found

Latest commit: 73b1d7e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dougfabris dougfabris added this to the 8.4.0 milestone Apr 7, 2026
@dougfabris
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 44.44444% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.15%. Comparing base (58fc21c) to head (73b1d7e).
⚠️ Report is 46 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40067      +/-   ##
===========================================
- Coverage    70.52%   70.15%   -0.37%     
===========================================
  Files         3271     3278       +7     
  Lines       116804   116605     -199     
  Branches     21066    20839     -227     
===========================================
- Hits         82376    81806     -570     
+ Misses       32379    31512     -867     
- Partials      2049     3287    +1238     
Flag Coverage Δ
e2e 59.68% <23.07%> (-0.82%) ⬇️
e2e-api 46.56% <0.00%> (-1.56%) ⬇️
unit 70.96% <60.00%> (+<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.

@dougfabris dougfabris force-pushed the refactor/remove-descriptionMd branch from 33d3826 to 84f4e7d Compare April 7, 2026 19:40
@dougfabris dougfabris marked this pull request as ready for review April 8, 2026 00:04
@dougfabris dougfabris requested review from a team as code owners April 8, 2026 00:05
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Copy link
Copy Markdown
Member

@MartinSchoeler MartinSchoeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ggazzo
ggazzo previously approved these changes Apr 9, 2026
@dougfabris dougfabris changed the title refactor: Remove unused descriptionMd from attachments render refactor: Remove unused description from attachments render Apr 9, 2026
Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts (1)

403-429: Redundant translated attachment test case.

This block duplicates the same scenario already covered by the later translated test, so it adds maintenance cost without extra coverage.

♻️ Proposed cleanup
-			it('should return correct attachment text translated parsed md when translate is active', () => {
-				const textAttachment = [
-					{
-						...attachmentMessage[0],
-						text: 'attachment not translated',
-						translationProvider: 'provider',
-						translations: {
-							en: 'attachment translated',
-						},
-					},
-				];
-				const textAttachmentParsed: Root = [
-					{
-						type: 'PARAGRAPH',
-						value: [
-							{
-								type: 'PLAIN_TEXT',
-								value: 'attachment translated',
-							},
-						],
-					},
-				];
-
-				expect(parseMessageAttachments(textAttachment, parseOptions, enabledAutoTranslatedOptions)[0].md).toStrictEqual(
-					textAttachmentParsed,
-				);
-			});
As per coding guidelines, "Use descriptive test names that clearly communicate expected behavior in Playwright tests."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts` around lines
403 - 429, The test case duplicates an existing translated-attachment scenario;
remove or consolidate this redundant test block to reduce maintenance. Locate
the it(...) block that constructs textAttachment, textAttachmentParsed and calls
parseMessageAttachments with parseOptions and enabledAutoTranslatedOptions, then
either delete this entire it(...) test or merge its assertions into the later
translated-attachment test, ensuring the remaining test keeps a descriptive name
and still asserts parseMessageAttachments(...)[0].md equals
textAttachmentParsed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts`:
- Around line 403-429: The test case duplicates an existing
translated-attachment scenario; remove or consolidate this redundant test block
to reduce maintenance. Locate the it(...) block that constructs textAttachment,
textAttachmentParsed and calls parseMessageAttachments with parseOptions and
enabledAutoTranslatedOptions, then either delete this entire it(...) test or
merge its assertions into the later translated-attachment test, ensuring the
remaining test keeps a descriptive name and still asserts
parseMessageAttachments(...)[0].md equals textAttachmentParsed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8adafb5e-dac3-4326-a803-a48e0d3443a2

📥 Commits

Reviewing files that changed from the base of the PR and between e4890cf and 5e379fd.

📒 Files selected for processing (25)
  • apps/meteor/app/apps/server/converters/messages.js
  • apps/meteor/app/autotranslate/client/lib/autotranslate.ts
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/app/autotranslate/server/deeplTranslate.ts
  • apps/meteor/app/autotranslate/server/googleTranslate.ts
  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/app/livechat/server/lib/sendTranscript.ts
  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts
  • apps/meteor/client/views/room/contextualBar/ExportMessages/useExportMessagesAsPDFMutation.tsx
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
  • ee/packages/omnichannel-services/src/OmnichannelTranscript.ts
💤 Files with no reviewable changes (7)
  • apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts
  • apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts
  • apps/meteor/app/apps/server/converters/messages.js
  • apps/meteor/app/livechat/server/lib/sendTranscript.ts
  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
  • apps/meteor/client/views/room/contextualBar/ExportMessages/useExportMessagesAsPDFMutation.tsx
  • apps/meteor/app/autotranslate/client/lib/autotranslate.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • ee/packages/omnichannel-services/src/OmnichannelTranscript.ts
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/app/autotranslate/server/deeplTranslate.ts
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/app/autotranslate/server/googleTranslate.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
🧠 Learnings (29)
📓 Common learnings
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/home-content.ts:60-82
Timestamp: 2026-02-24T19:36:55.089Z
Learning: In RocketChat/Rocket.Chat e2e tests (apps/meteor/tests/e2e/page-objects/fragments/home-content.ts), thread message preview listitems do not have aria-roledescription="message", so lastThreadMessagePreview locator cannot be scoped to messageListItems (which filters for aria-roledescription="message"). It should remain scoped to page.getByRole('listitem') or mainMessageList.getByRole('listitem').
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 39230
File: apps/meteor/app/api/server/v1/chat.ts:214-222
Timestamp: 2026-03-03T11:11:48.541Z
Learning: In apps/meteor/server/lib/moderation/reportMessage.ts, the reportMessage function validates that description is not empty or whitespace-only with `if (!description.trim())`. When migrating the chat.reportMessage endpoint to OpenAPI, adding minLength validation to the schema preserves this existing behavior.
📚 Learning: 2026-03-03T11:11:48.541Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 39230
File: apps/meteor/app/api/server/v1/chat.ts:214-222
Timestamp: 2026-03-03T11:11:48.541Z
Learning: In apps/meteor/server/lib/moderation/reportMessage.ts, the reportMessage function validates that description is not empty or whitespace-only with `if (!description.trim())`. When migrating the chat.reportMessage endpoint to OpenAPI, adding minLength validation to the schema preserves this existing behavior.

Applied to files:

  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • ee/packages/omnichannel-services/src/OmnichannelTranscript.ts
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/app/autotranslate/server/deeplTranslate.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/app/autotranslate/server/googleTranslate.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-03-20T13:51:23.302Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 39553
File: apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts:179-181
Timestamp: 2026-03-20T13:51:23.302Z
Learning: In `apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts`, the truthiness guards `...(integration.avatar && { avatar })`, `...(integration.emoji && { emoji })`, `...(integration.alias && { alias })`, and `...(integration.script && { script })` in the `$set` payload of `updateIncomingIntegration` are intentional. Empty-string values for these fields should NOT overwrite the stored value — only truthy values are persisted. Do not flag these as bugs preventing explicit clears.

Applied to files:

  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/app/autotranslate/server/deeplTranslate.ts
  • apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/app/autotranslate/server/googleTranslate.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • ee/packages/omnichannel-services/src/OmnichannelTranscript.ts
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/app/autotranslate/server/deeplTranslate.ts
  • apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/app/autotranslate/server/googleTranslate.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/autotranslate/server/msTranslate.ts
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • ee/packages/omnichannel-services/src/OmnichannelTranscript.ts
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/app/autotranslate/server/deeplTranslate.ts
  • apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/app/autotranslate/server/googleTranslate.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-02-24T19:36:55.089Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/home-content.ts:60-82
Timestamp: 2026-02-24T19:36:55.089Z
Learning: In RocketChat/Rocket.Chat e2e tests (apps/meteor/tests/e2e/page-objects/fragments/home-content.ts), thread message preview listitems do not have aria-roledescription="message", so lastThreadMessagePreview locator cannot be scoped to messageListItems (which filters for aria-roledescription="message"). It should remain scoped to page.getByRole('listitem') or mainMessageList.getByRole('listitem').

Applied to files:

  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-03-11T18:17:53.972Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/processMessageUploads.ts:112-119
Timestamp: 2026-03-11T18:17:53.972Z
Learning: In `apps/meteor/client/lib/chats/flows/processMessageUploads.ts`, when sending multiple file uploads, each file is confirmed via its own `/rooms.mediaConfirm/${rid}/${fileId}` call and produces a separate message. Only the first file's confirm payload carries the composed message text (`msg`); all subsequent files receive `msg: ''`. This one-message-per-file behavior is intentional by design — do not flag it as a bug or suggest batching into a single message.

Applied to files:

  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • ee/packages/omnichannel-services/src/OmnichannelTranscript.ts
  • apps/meteor/app/autotranslate/server/autotranslate.ts
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-03-11T22:04:20.529Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 39545
File: apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts:59-61
Timestamp: 2026-03-11T22:04:20.529Z
Learning: In `apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts`, the `msg.u._id === uid` early-return in the `streamNewMessage` handler is intentional: the "New messages" indicator is designed to notify about messages from other users only. Self-sent messages — including those sent from a different session/device — are always skipped, by design. Do not flag this as a multi-session regression.

Applied to files:

  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2026-03-11T18:15:53.272Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/app/api/server/v1/rooms.ts:294-296
Timestamp: 2026-03-11T18:15:53.272Z
Learning: In Rocket.Chat's `rooms.mediaConfirm/:rid/:fileId` endpoint (apps/meteor/app/api/server/v1/rooms.ts), updating `file.name` from `bodyParams.fileName` without updating `file.path` is intentionally safe. The file path is keyed by `_id` (not by filename), so the stored path remains valid regardless of a rename. `file.name` only affects the display name in the message attachment; do not flag this as a path-divergence issue.

Applied to files:

  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
  • apps/meteor/app/lib/server/methods/updateMessage.ts
📚 Learning: 2026-03-12T17:12:49.121Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:28-33
Timestamp: 2026-03-12T17:12:49.121Z
Learning: Rocket.Chat — apps/meteor/client/lib/chats/flows/uploadFiles.ts: When E2E_Enable_Encrypt_Files is disabled, plaintext file uploads are allowed in E2E rooms; this fallback is expected and should not be flagged as a security regression.

Applied to files:

  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/app/lib/server/functions/notifications/email.js
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/lib/normalizeThreadMessage.tsx
  • apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx
📚 Learning: 2026-02-24T19:16:35.307Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 39003
File: apps/meteor/client/lib/chats/flows/sendMessage.ts:39-45
Timestamp: 2026-02-24T19:16:35.307Z
Learning: In apps/meteor/client/lib/chats/flows/sendMessage.ts, when sdk.call('sendMessage', ...) throws an error, the message is intentionally left with temp: true (not deleted or cleaned up) to support a future retry UI feature. This allows users to retry sending failed messages rather than losing them.

Applied to files:

  • apps/meteor/app/ui/client/lib/ChatMessages.ts
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.

Applied to files:

  • apps/meteor/app/ui/client/lib/ChatMessages.ts
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.

Applied to files:

  • apps/meteor/app/ui/client/lib/ChatMessages.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

Applied to files:

  • apps/meteor/app/autotranslate/server/autotranslate.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2026-02-12T15:39:28.416Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 32703
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:52-58
Timestamp: 2026-02-12T15:39:28.416Z
Learning: In `apps/meteor/client/lib/chats/flows/uploadFiles.ts`, when E2E encryption is required but not allowed (e.g., `E2E_Enable_Encrypt_Files` setting is disabled), the function intentionally abandons the entire upload queue and displays a toast error. This fail-fast behavior prevents partial uploads when encryption requirements cannot be met and is the expected behavior, not a bug.

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2026-03-14T14:58:58.834Z
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests

Applied to files:

  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • apps/meteor/app/lib/server/methods/updateMessage.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests

Applied to files:

  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
🔇 Additional comments (20)
apps/meteor/app/lib/server/functions/notifications/email.js (1)

80-81: Good cleanup: file email body now correctly renders only file names.

This aligns with the removal of descriptionMd/description-based file rendering and keeps output safely escaped via escapeHTML.

apps/meteor/client/hooks/useDecryptedMessage.ts (1)

21-22: Attachment fallback is correctly decoupled from description fields.

Good change: the fallback now consistently uses Message_with_attachment when decrypted text is empty but attachments exist, matching the new behavior and avoiding dependency on attachment description content.

apps/meteor/client/hooks/useDecryptedMessage.spec.ts (1)

53-64: Test expectations now correctly reflect generic attachment fallback behavior.

The updated mock/assertion correctly verifies that attachment-only decrypted payloads resolve to Message_with_attachment, without relying on removed description-based fields.

apps/meteor/app/ui/client/lib/ChatMessages.ts (1)

123-123: Looks good: edit prefill now correctly avoids attachment description fallback.

Line 123 aligns with this PR’s intent by restricting edit prefill to draft text or message.msg, so attachment description/alt-text content is no longer pulled into the composer.

apps/meteor/app/autotranslate/server/msTranslate.ts (1)

195-195: Text-only attachment translation input looks correct.

Line 195 correctly aligns this provider with the new text-only attachment translation behavior.

apps/meteor/app/autotranslate/server/deeplTranslate.ts (1)

199-199: DeepL request payload update is consistent and safe.

Line 199 correctly keeps attachment translation sourced from attachment.text only.

apps/meteor/app/autotranslate/server/googleTranslate.ts (1)

198-198: Google attachment translation input change is good.

Line 198 correctly removes description fallback and keeps translation input scoped to attachment.text.

apps/meteor/app/autotranslate/server/autotranslate.ts (1)

323-323: Attachment translation gating update is correct.

Line 323 appropriately restricts attachment translation to entries with attachment.text, matching the new behavior.

apps/meteor/client/lib/normalizeThreadMessage.tsx (1)

27-33: LGTM!

The attachment selection logic now correctly uses only title for finding a displayable attachment, aligning with the PR's objective to remove description from rendering paths. The pattern is consistent with other files in this PR (e.g., useMessageBody.tsx, useNormalizedThreadTitleHtml.ts).

apps/meteor/client/views/room/contextualBar/Threads/hooks/useNormalizedThreadTitleHtml.ts (1)

35-41: LGTM!

The attachment selection logic is updated to use only title, with proper HTML escaping applied via escapeHTML(). This is consistent with the PR's objective and matches the pattern used across other normalization utilities.

apps/meteor/app/lib/server/methods/updateMessage.ts (1)

37-40: LGTM!

The early-return comparison is simplified to only check originalMessage.msg against message.msg, removing the previous fallback to attachments[0]?.description. This aligns with the PR's objective to stop treating attachment description as editable message content.

ee/packages/omnichannel-services/src/OmnichannelTranscript.ts (1)

315-324: LGTM!

The transcript message data now correctly uses only message.msg (defaulting to empty string) instead of falling back to attachment description. File attachments are still included via the files array, so file uploads will continue to appear in transcripts with their names/images.

apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts (1)

145-145: LGTM!

The email body text now correctly uses only message?.msg instead of concatenating attachment descriptions. File attachments are still included via validAttachments, ensuring files are properly sent with the email.

apps/meteor/client/views/room/MessageList/hooks/useMessageBody.tsx (1)

33-39: LGTM!

The attachment selection logic is updated to use only title, consistent with the pattern applied across all message body/preview normalization utilities in this PR.

apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.ts (1)

13-21: LGTM!

The attachment selection logic correctly uses only title with proper HTML escaping, and appropriately falls back to the translated 'Sent_an_attachment' message when no titled attachment is found.

apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts (2)

50-78: LGTM!

Tests are correctly updated to reflect the new behavior where only title is used for attachment preview selection. The test names clearly communicate the expected behavior.


151-169: LGTM!

The edge case test correctly verifies that when attachments exist but none have a title, the function returns the translated 'Sent_an_attachment' fallback.

apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts (3)

185-208: attachment.text translation assertions are correctly aligned.

This update matches the parser behavior and correctly validates translated md generation from attachment.text.


381-383: Attachment fixture source field migration looks correct.

Switching the fixture payload to text is consistent with current attachment parsing inputs.


431-459: Undefined autoTranslateLanguage fallback coverage is good.

This test clearly validates fallback to non-translated attachment.text when no language is provided.

Copy link
Copy Markdown
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/app/slackbridge/server/RocketAdapter.ts (1)

206-214: ⚠️ Potential issue | 🟡 Minor

Avoid sending "undefined" or leading-space text in file-share Slack messages.

Line 213 currently interpolates rocketMessage.msg directly. When it is missing/empty, Slack can receive "undefined <file>" or " <file>". Compose msg from non-empty parts.

Proposed fix
-			const text = rocketMessage.msg;
+			const text = rocketMessage.msg?.trim();

 			const attachment = this.getMessageAttachment(rocketMessage);
 			if (attachment) {
 				fileName = Meteor.absoluteUrl(attachment.title_link);
 			}

-			await slack.postMessage(slack.getSlackChannel(rocketMessage.rid), { ...rocketMessage, msg: `${text} ${fileName}` });
+			const msg = [text, fileName].filter(Boolean).join(' ');
+			await slack.postMessage(slack.getSlackChannel(rocketMessage.rid), { ...rocketMessage, msg });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/slackbridge/server/RocketAdapter.ts` around lines 206 - 214,
The current send composes msg by interpolating rocketMessage.msg and fileName
which can produce "undefined <file>" or a leading space; update the logic in
RocketAdapter (where getMessageAttachment, slack.getSlackChannel and
slack.postMessage are used) to build msg from non-empty parts only: compute text
= rocketMessage.msg || '' and fileName as before, then create msg by joining
[text, fileName].filter(Boolean).join(' ') (or equivalent) and trim the result
before passing it to slack.postMessage so no "undefined" or extra spaces are
sent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@apps/meteor/app/slackbridge/server/RocketAdapter.ts`:
- Around line 206-214: The current send composes msg by interpolating
rocketMessage.msg and fileName which can produce "undefined <file>" or a leading
space; update the logic in RocketAdapter (where getMessageAttachment,
slack.getSlackChannel and slack.postMessage are used) to build msg from
non-empty parts only: compute text = rocketMessage.msg || '' and fileName as
before, then create msg by joining [text, fileName].filter(Boolean).join(' ')
(or equivalent) and trim the result before passing it to slack.postMessage so no
"undefined" or extra spaces are sent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edea23f8-2745-4980-b682-588c615df788

📥 Commits

Reviewing files that changed from the base of the PR and between 5e379fd and 3953de9.

📒 Files selected for processing (3)
  • apps/meteor/app/livechat/server/lib/sendTranscript.ts
  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/app/livechat/server/lib/sendTranscript.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
🧠 Learnings (12)
📚 Learning: 2026-03-11T18:15:53.272Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/app/api/server/v1/rooms.ts:294-296
Timestamp: 2026-03-11T18:15:53.272Z
Learning: In Rocket.Chat's `rooms.mediaConfirm/:rid/:fileId` endpoint (apps/meteor/app/api/server/v1/rooms.ts), updating `file.name` from `bodyParams.fileName` without updating `file.path` is intentionally safe. The file path is keyed by `_id` (not by filename), so the stored path remains valid regardless of a rename. `file.name` only affects the display name in the message attachment; do not flag this as a path-divergence issue.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-03-11T18:17:53.972Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/processMessageUploads.ts:112-119
Timestamp: 2026-03-11T18:17:53.972Z
Learning: In `apps/meteor/client/lib/chats/flows/processMessageUploads.ts`, when sending multiple file uploads, each file is confirmed via its own `/rooms.mediaConfirm/${rid}/${fileId}` call and produces a separate message. Only the first file's confirm payload carries the composed message text (`msg`); all subsequent files receive `msg: ''`. This one-message-per-file behavior is intentional by design — do not flag it as a bug or suggest batching into a single message.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-02-25T20:10:16.987Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38913
File: packages/ddp-client/src/legacy/types/SDKLegacy.ts:34-34
Timestamp: 2026-02-25T20:10:16.987Z
Learning: In the RocketChat/Rocket.Chat monorepo, packages/ddp-client and apps/meteor do not use TypeScript project references. Module augmentations in apps/meteor (e.g., declare module 'rocket.chat/rest-typings') are not visible when compiling packages/ddp-client in isolation, which is why legacy SDK methods that depend on OperationResult types for OpenAPI-migrated endpoints must remain commented out.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 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:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-02-24T19:36:55.089Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/home-content.ts:60-82
Timestamp: 2026-02-24T19:36:55.089Z
Learning: In RocketChat/Rocket.Chat e2e tests (apps/meteor/tests/e2e/page-objects/fragments/home-content.ts), thread message preview listitems do not have aria-roledescription="message", so lastThreadMessagePreview locator cannot be scoped to messageListItems (which filters for aria-roledescription="message"). It should remain scoped to page.getByRole('listitem') or mainMessageList.getByRole('listitem').

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-03-20T13:51:23.302Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 39553
File: apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts:179-181
Timestamp: 2026-03-20T13:51:23.302Z
Learning: In `apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts`, the truthiness guards `...(integration.avatar && { avatar })`, `...(integration.emoji && { emoji })`, `...(integration.alias && { alias })`, and `...(integration.script && { script })` in the `$set` payload of `updateIncomingIntegration` are intentional. Empty-string values for these fields should NOT overwrite the stored value — only truthy values are persisted. Do not flag these as bugs preventing explicit clears.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-03-03T11:11:48.541Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 39230
File: apps/meteor/app/api/server/v1/chat.ts:214-222
Timestamp: 2026-03-03T11:11:48.541Z
Learning: In apps/meteor/server/lib/moderation/reportMessage.ts, the reportMessage function validates that description is not empty or whitespace-only with `if (!description.trim())`. When migrating the chat.reportMessage endpoint to OpenAPI, adding minLength validation to the schema preserves this existing behavior.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-03-12T17:12:49.121Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:28-33
Timestamp: 2026-03-12T17:12:49.121Z
Learning: Rocket.Chat — apps/meteor/client/lib/chats/flows/uploadFiles.ts: When E2E_Enable_Encrypt_Files is disabled, plaintext file uploads are allowed in E2E rooms; this fallback is expected and should not be flagged as a security regression.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/slackbridge/server/RocketAdapter.ts

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/hooks/useDecryptedMessage.ts">

<violation number="1" location="apps/meteor/client/hooks/useDecryptedMessage.ts:23">
P2: This unconditional second `if` overwrites decrypted text when attachments are also present. Use `else if` to preserve text precedence and avoid changing message rendering behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
apps/meteor/tests/end-to-end/api/rooms.ts (1)

483-483: Strengthen the msg assertion to prevent false positives

Line 483 currently only proves msg !== 'some_file_description'. It still passes if msg is accidentally populated with another non-empty value. Consider asserting msg is absent or empty.

Proposed assertion tightening
-					expect(res.body.message).to.not.have.property('msg', 'some_file_description');
+					expect(res.body.message.msg).to.be.oneOf([undefined, '']);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/tests/end-to-end/api/rooms.ts` at line 483, The current assertion
only checks that res.body.message.msg is not equal to 'some_file_description'
which can still pass if msg contains some other non-empty value; update the
assertion on res.body.message to either assert the 'msg' property is absent
(e.g., ensure no property 'msg') or assert it is empty (e.g., msg === '' or
length === 0) so the test fails if any unexpected non-empty value appears —
locate the assertion referencing res.body.message and replace the negated
equality check with a strict absence or empty-string assertion on the 'msg'
property.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/meteor/tests/end-to-end/api/rooms.ts`:
- Line 483: The current assertion only checks that res.body.message.msg is not
equal to 'some_file_description' which can still pass if msg contains some other
non-empty value; update the assertion on res.body.message to either assert the
'msg' property is absent (e.g., ensure no property 'msg') or assert it is empty
(e.g., msg === '' or length === 0) so the test fails if any unexpected non-empty
value appears — locate the assertion referencing res.body.message and replace
the negated equality check with a strict absence or empty-string assertion on
the 'msg' property.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22521c40-2c86-4e21-9d7f-8d0cea7c58b4

📥 Commits

Reviewing files that changed from the base of the PR and between 3953de9 and 4cddf0f.

📒 Files selected for processing (5)
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
  • apps/meteor/tests/end-to-end/api/rooms.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/meteor/client/hooks/useDecryptedMessage.ts
  • apps/meteor/client/hooks/useDecryptedMessage.spec.ts
  • apps/meteor/client/lib/parseMessageTextToAstMarkdown.spec.ts
  • apps/meteor/client/lib/utils/normalizeMessagePreview/normalizeMessagePreview.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 📦 Meteor Build (coverage)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 39230
File: apps/meteor/app/api/server/v1/chat.ts:214-222
Timestamp: 2026-03-03T11:11:48.541Z
Learning: In apps/meteor/server/lib/moderation/reportMessage.ts, the reportMessage function validates that description is not empty or whitespace-only with `if (!description.trim())`. When migrating the chat.reportMessage endpoint to OpenAPI, adding minLength validation to the schema preserves this existing behavior.
📚 Learning: 2026-03-12T17:12:49.121Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:28-33
Timestamp: 2026-03-12T17:12:49.121Z
Learning: Rocket.Chat — apps/meteor/client/lib/chats/flows/uploadFiles.ts: When E2E_Enable_Encrypt_Files is disabled, plaintext file uploads are allowed in E2E rooms; this fallback is expected and should not be flagged as a security regression.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-03-11T18:17:53.972Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/client/lib/chats/flows/processMessageUploads.ts:112-119
Timestamp: 2026-03-11T18:17:53.972Z
Learning: In `apps/meteor/client/lib/chats/flows/processMessageUploads.ts`, when sending multiple file uploads, each file is confirmed via its own `/rooms.mediaConfirm/${rid}/${fileId}` call and produces a separate message. Only the first file's confirm payload carries the composed message text (`msg`); all subsequent files receive `msg: ''`. This one-message-per-file behavior is intentional by design — do not flag it as a bug or suggest batching into a single message.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-03-19T13:59:40.678Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38357
File: apps/meteor/app/apps/server/converters/uploads.ts:45-49
Timestamp: 2026-03-19T13:59:40.678Z
Learning: In `apps/meteor/app/apps/server/converters/uploads.ts`, the `room` async handler in `convertToApp` uses non-null assertions (`upload.rid!` and `result!`) intentionally. The data flow guarantees that any upload reaching this point must have a `rid`; if it does not, throwing an error is the desired behavior (fail-fast / data integrity guard). Do not flag these non-null assertions as unsafe during code review.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-03-11T18:15:53.272Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39425
File: apps/meteor/app/api/server/v1/rooms.ts:294-296
Timestamp: 2026-03-11T18:15:53.272Z
Learning: In Rocket.Chat's `rooms.mediaConfirm/:rid/:fileId` endpoint (apps/meteor/app/api/server/v1/rooms.ts), updating `file.name` from `bodyParams.fileName` without updating `file.path` is intentionally safe. The file path is keyed by `_id` (not by filename), so the stored path remains valid regardless of a rename. `file.name` only affects the display name in the message attachment; do not flag this as a path-divergence issue.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-02-12T15:39:28.416Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 32703
File: apps/meteor/client/lib/chats/flows/uploadFiles.ts:52-58
Timestamp: 2026-02-12T15:39:28.416Z
Learning: In `apps/meteor/client/lib/chats/flows/uploadFiles.ts`, when E2E encryption is required but not allowed (e.g., `E2E_Enable_Encrypt_Files` setting is disabled), the function intentionally abandons the entire upload queue and displays a toast error. This fail-fast behavior prevents partial uploads when encryption requirements cannot be met and is the expected behavior, not a bug.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-03-11T22:04:20.529Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 39545
File: apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts:59-61
Timestamp: 2026-03-11T22:04:20.529Z
Learning: In `apps/meteor/client/views/room/body/hooks/useHasNewMessages.ts`, the `msg.u._id === uid` early-return in the `streamNewMessage` handler is intentional: the "New messages" indicator is designed to notify about messages from other users only. Self-sent messages — including those sent from a different session/device — are always skipped, by design. Do not flag this as a multi-session regression.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-02-24T19:36:55.089Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/home-content.ts:60-82
Timestamp: 2026-02-24T19:36:55.089Z
Learning: In RocketChat/Rocket.Chat e2e tests (apps/meteor/tests/e2e/page-objects/fragments/home-content.ts), thread message preview listitems do not have aria-roledescription="message", so lastThreadMessagePreview locator cannot be scoped to messageListItems (which filters for aria-roledescription="message"). It should remain scoped to page.getByRole('listitem') or mainMessageList.getByRole('listitem').

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-03-10T08:13:52.153Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 39414
File: apps/meteor/app/api/server/v1/rooms.ts:1241-1297
Timestamp: 2026-03-10T08:13:52.153Z
Learning: In the RocketChat/Rocket.Chat OpenAPI migration PRs for endpoints under apps/meteor/app/api/server/v1/rooms.ts, the pattern `ajv.compile<void>({...})` is intentionally used for the 200 response schema even when the endpoint returns `{ success: true }`. This is an established convention across all migrated endpoints (rooms.leave, rooms.favorite, rooms.delete, rooms.muteUser, rooms.unmuteUser). Do not flag this as a type mismatch during reviews of these migration PRs.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/end-to-end/api/rooms.ts

ggazzo
ggazzo previously approved these changes Apr 10, 2026
@dougfabris dougfabris force-pushed the refactor/remove-descriptionMd branch from 7e75f26 to 73b1d7e Compare April 10, 2026 17:36
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Apr 10, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 10, 2026
@dionisio-bot dionisio-bot bot enabled auto-merge April 10, 2026 18:26
@ggazzo ggazzo disabled auto-merge April 10, 2026 18:41
@ggazzo ggazzo merged commit 9760d84 into develop Apr 10, 2026
78 of 81 checks passed
@ggazzo ggazzo deleted the refactor/remove-descriptionMd branch April 10, 2026 18:41
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 type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants