EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

fix: update file upload to use RC 8.x rooms.media API

Open dodaa08 opened this issue 3 days ago • 0 comments

Description:

File uploads fail with a 404 Not Found error when using EmbeddedChat with Rocket.Chat 8.x servers. The sendAttachment function uses the deprecated /api/v1/rooms.upload/:rid endpoint which was replaced in RC 8.x with a new two-step process using /api/v1/rooms.media/:rid and /api/v1/rooms.mediaConfirm/:rid/:fileId.

Steps to reproduce:

  1. Connect EmbeddedChat to a Rocket.Chat 8.x server
  2. Log in to the chat
  3. Try to upload a file (image, document, etc.) using the attachment button
  4. Observe the network request failing with 404

Expected behavior:

File should upload successfully and appear in the chat.

Actual behavior:

Upload fails with: POST http://localhost:3000/api/v1/rooms.upload/{roomId} 404 (Not Found)sendAttachment error: Server error 404 404 Not Found

The file is never uploaded because Rocket.Chat 8.x uses the new rooms.media + rooms.mediaConfirm two-step process

https://github.com/user-attachments/assets/0f9b7b0b-429a-44c7-9fd2-ebfd7a0526ec

Hoping this issue happens globally due to, hitting the old file upload endpoint

dodaa08 avatar Jan 15 '26 16:01 dodaa08