Skip to content

Conversation

@pierre-lehnen-rc
Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc commented Jan 8, 2026

Proposed changes (including videos or screenshots)

Issue(s)

CORE-1633

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features
    • Messages now support multiple file attachments via a new files field; the old single-file field is deprecated.
    • Attachment processing now infers thumbnails for certain two-file + single-attachment cases and better surfaces file metadata.
  • Bug Fixes
    • Attachments more reliably link to their corresponding files so file references display correctly.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 8, 2026

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 8.2.0, but it targets 8.1.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 091f25c

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

Added a plural files field to IMessage (marking file deprecated), introduced convertMessageFiles, and updated message converters to propagate message context into attachment conversion, infer fileId, and mark thumbnail metadata during conversion.

Changes

Cohort / File(s) Summary
App Converters
apps/meteor/app/apps/server/converters/messages.js, apps/meteor/app/apps/server/converters/threads.ts, apps/meteor/app/apps/server/converters/convertMessageFiles.ts
Added convertMessageFiles and wired a files resolver into message conversion; changed _convertAttachmentsToApp(attachments)_convertAttachmentsToApp(attachments, mainFile) and updated call sites to pass message context; added logic to infer fileId from mainFile and to mark thumbnail typeGroup when files/attachments match specific patterns.
Message Types
packages/apps-engine/src/definition/messages/IMessage.ts
Added optional files?: IMessageFile[] and marked existing file?: IMessageFile as deprecated in JSDoc.
Imports / Typings
apps/meteor/app/apps/server/converters/threads.ts
Imported isFileAttachment and adjusted typing/usages to detect file attachments for fileId inference.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • KevLehman
  • tassoevan

Poem

🐇 I found some files and gave a hop,
From single file to a plural crop.
Attachments whisper which id to keep,
Thumbs now wear a tiny typeGroup peep.
Hooray — I hopped and danced — then ate a carrot! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
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.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR addresses the core objective of CORE-1633 by implementing IMessage.files exposure to Apps.Engine, enabling compatibility with the new message file format.
Out of Scope Changes check ✅ Passed All changes are directly scoped to exposing IMessage.files to apps: interface updates, file converters, and attachment processing enhancements—no unrelated modifications detected.
Title check ✅ Passed The pull request title clearly and specifically summarizes the main change: introducing the files property to the IMessage interface and exposing it to apps.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/message-files-apps

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.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 37.50000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.46%. Comparing base (7a10990) to head (091f25c).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38099      +/-   ##
===========================================
- Coverage    70.85%   70.46%   -0.39%     
===========================================
  Files         3161     3162       +1     
  Lines       109785   110165     +380     
  Branches     19688    19890     +202     
===========================================
- Hits         77783    77631     -152     
- Misses       29973    30500     +527     
- Partials      2029     2034       +5     
Flag Coverage Δ
unit 71.51% <37.50%> (-0.54%) ⬇️

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

📦 Docker Image Size Report

➡️ Changes

Service Current Baseline Change Percent
sum of all images 0B 0B 0B
account-service 0B 0B 0B
authorization-service 0B 0B 0B
ddp-streamer-service 0B 0B 0B
omnichannel-transcript-service 0B 0B 0B
presence-service 0B 0B 0B
queue-worker-service 0B 0B 0B
rocketchat 0B 0B 0B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "01/30 18:16 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.00]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "queue-worker-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "rocketchat" [0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.00]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 0B
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-38099
  • Baseline: develop
  • Timestamp: 2026-01-30 18:16:15 UTC
  • Historical data points: 30

Updated: Fri, 30 Jan 2026 18:16:15 GMT

@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as ready for review January 8, 2026 15:01
@pierre-lehnen-rc pierre-lehnen-rc requested a review from a team as a code owner January 8, 2026 15:01
@pierre-lehnen-rc pierre-lehnen-rc added this to the 8.1.0 milestone Jan 8, 2026
Copy link
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 3 files

d-gubert
d-gubert previously approved these changes Jan 14, 2026
@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as draft January 14, 2026 15:07
@dougfabris dougfabris modified the milestones: 8.1.0, 8.2.0 Jan 19, 2026
@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as ready for review January 29, 2026 17:36
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@apps/meteor/app/apps/server/converters/messages.js`:
- Around line 342-349: The fileId resolver currently only falls back to
message.file, so new-format messages using message.files can yield undefined;
update the fileId arrow function (the attachment.fileId handler) to first check
for message.files && message.files.length === 1 and return message.files[0]._id,
then fall back to message.file._id if present, and otherwise return
attachment.fileId; also remove the inline comment from that function body per
guidelines.

In `@apps/meteor/app/apps/server/converters/threads.ts`:
- Around line 203-214: The fileId getter currently only falls back to
message.file; update the logic in the fileId function inside the converter in
threads.ts to also check message.files when message.attachments length === 1: if
isFileAttachment(attachment) and message.files?.length === 1 and
message.files[0]?._id return that ID (before falling back to message.file),
remove the inline comment as per guidelines, and keep other return paths
(existing attachment.fileId and final undefined) intact.
🧹 Nitpick comments (2)
apps/meteor/app/apps/server/converters/messages.js (1)

98-114: Replace inline comment with a self-documenting predicate.

The logic is fine, but the inline comment can be removed by naming the condition.

Proposed refactor
-				return message.files?.map((file) => {
+				return message.files?.map((file) => {
 					if (!file || file.typeGroup) {
 						return file;
 					}
 
-					// Thumbnails from older messages did not have any identification but we can extrapolate this information from other data
-					if (message.files.length === 2 && message.attachments?.length === 1 && file === message.files[1]) {
+					const isLegacyThumb =
+						message.files.length === 2 && message.attachments?.length === 1 && file === message.files[1];
+					if (isLegacyThumb) {
 						return {
 							...file,
 							typeGroup: 'thumb',
 						};
 					}

As per coding guidelines: Avoid code comments in the implementation.

apps/meteor/app/apps/server/converters/threads.ts (1)

122-138: Replace inline comment with a self-documenting predicate.

The logic is fine, but the inline comment can be removed by naming the condition.

Proposed refactor
-			files: async (message: IMessage) => {
+			files: async (message: IMessage) => {
 				return message.files?.map((file) => {
 					if (!file || file.typeGroup) {
 						return file;
 					}
 
-					// Thumbnails from older messages did not have any identification but we can extrapolate this information from other data
-					if (message.files?.length === 2 && message.attachments?.length === 1 && file === message.files[1]) {
+					const isLegacyThumb =
+						message.files?.length === 2 && message.attachments?.length === 1 && file === message.files[1];
+					if (isLegacyThumb) {
 						return {
 							...file,
 							typeGroup: 'thumb',
 						};
 					}

As per coding guidelines: Avoid code comments in the implementation.

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

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/meteor/app/apps/server/converters/threads.ts">

<violation number="1" location="apps/meteor/app/apps/server/converters/threads.ts:129">
P2: The new thumbnail detection in `files` checks `message.attachments?.length`, but `attachments` is deleted earlier in the same map execution. Because `transformMappedData` iterates map entries in order, this condition will always be false and legacy thumbnails won’t get `typeGroup: 'thumb'`. Capture the attachments count before deletion or use the original message value instead.</violation>
</file>

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

@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as draft January 29, 2026 19:12
@pierre-lehnen-rc pierre-lehnen-rc marked this pull request as ready for review January 30, 2026 18:19
Copy link
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 6 files

d-gubert
d-gubert previously approved these changes Feb 5, 2026
@d-gubert d-gubert changed the title chore: expose IMessage.files to apps feat: expose IMessage.files to apps Feb 5, 2026
@d-gubert d-gubert dismissed their stale review February 5, 2026 16:18

Needs changeset with bump to apps-engine

@d-gubert d-gubert changed the title feat: expose IMessage.files to apps feat(apps): new IMessage.files to apps Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants