fix(messages): merge partial WS updates + display edited content

message_updated broadcasts only {id, edited_content, edited_at} (+ reset
ai_* fields), but the frontend replaced the whole cached record, wiping
username/content/channel_id/created_at -> blank cards and the
'the channel_id of undefined' crash on /messages. Merge partials over the
existing record (list + detail), make list-patching channel-filter aware,
show edited content/badge, and fix the message_updated WS type.

Also broadcast type:'edited' + ai reset in message_updated so the live UI
matches the DB update.
This commit is contained in:
asepharyana
2026-08-02 10:27:41 +07:00
parent a82265f4a9
commit 3f199aa70d
6 changed files with 92 additions and 22 deletions
@@ -44,8 +44,10 @@ export function MessageDetailView({
{/* Content */}
<div className="text-sm text-text-primary/90 leading-relaxed mb-4 whitespace-pre-wrap">
{renderMessageContent(message.content, message.metadata) ||
"(no text content)"}
{renderMessageContent(
message.edited_content ?? message.content,
message.metadata,
) || "(no text content)"}
</div>
{/* Attachments */}