Commit f16183fd authored by iamdoctorclaw's avatar iamdoctorclaw
Browse files

v0.7.1: fix duplicate image delivery from inbound file uploads



Use msg.file (singular) instead of msg.files (plural) as the primary
source for inbound file extraction. msg.files can include server-generated
thumbnails/previews alongside the original, causing the agent to receive
both the full image and a downscaled copy. msg.file is always the single
user-uploaded file. Multi-file uploads create separate RC messages, so
msg.file covers all cases. Falls back to msg.files when msg.file is absent.

Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <noreply@anthropic.com>
parent 7e31a7fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
  "id": "rocketchat-openclaw",
  "name": "Rocket.Chat (Open Source)",
  "description": "Open-source Rocket.Chat channel plugin for OpenClaw",
  "version": "0.7.0",
  "version": "0.7.1",
  "channels": [
    "rocketchat"
  ],
+1 −1
Original line number Diff line number Diff line
@@ -56,5 +56,5 @@
    "typescript": "^5.7.0",
    "vitest": "^4.1.0"
  },
  "version": "0.7.0"
  "version": "0.7.1"
}
+5 −1
Original line number Diff line number Diff line
@@ -122,7 +122,11 @@ function extractFileUrls(
): Array<{ url: string; mimeType?: string; fileName?: string }> {
  const files: Array<{ url: string; mimeType?: string; fileName?: string }> = [];

  const fileList = msg.files ?? (msg.file ? [msg.file] : []);
  // Use msg.file (singular) — always the primary user-uploaded file.
  // msg.files (plural) includes server-generated variants (thumbnails/previews)
  // that we don't want. Multi-file uploads create separate RC messages, so
  // msg.file is always the one file per message.
  const fileList = msg.file ? [msg.file] : (msg.files ?? []);
  for (const f of fileList) {
    if (f._id && f.name) {
      files.push({