-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Description
When sending a chat message using useChat() with an attachment, the sender (local) receives a message object that contains:
attachedFilesattributes(if provided)
However, the receiver (remote) does not receive these fields at all.
They are completely missing, not even present as undefined.
Remote message object does not contain attachedFiles or attributes keys.
Steps to Reproduce
Start two clients connected to the same LiveKit room.
In one client (sender), call:
import { useChat } from '@livekit/components-react';
const { chatMessages, isSending, send } = useChat();
const handleSendMessage = async () => {
try {
setMessageText('');
await send(messageText, { attachments: [file] });
} catch {}
}Log chatMessages from useChat() on both clients.
Expected Behavior
Both the sender and receiver should receive identical message structure, including:
{
message: "...",
attachedFiles: [...],
attributes: {...},
...
}Actual Behavior
Sender (local) message object includes both fields:
{
message: "hello",
attachedFiles: [File],
attributes: { foo: "bar" },
...
}Receiver (remote) message object does not include either field:
{
message: "hello",
// attachedFiles → missing
// attributes → missing
...
}Both fields are entirely absent from the remote message object.
Code Snippet
import { useChat } from '@livekit/components-react';
const { chatMessages, send } = useChat();
await send(messageText, {
attachments: [file] ,
attributes: { foo: 'bar' }
});Logging messages:
console.log(chatMessages);
Remote logs show no attachedFiles or attributes properties at all.
Describe the proposed solution
Include attachedFiles and attributes in the chat message so remote users receive the same structure.
Alternatives considered
No response
Importance
I cannot use LiveKit without it
Additional Information
No response