Skip to content

[tasks] Resolve reply authors when a realtime reply arrives - #2168

Open
tinnhcgi wants to merge 1 commit into
cgwire:mainfrom
tinnhcgi:fix/reply-avatar-enrich
Open

[tasks] Resolve reply authors when a realtime reply arrives#2168
tinnhcgi wants to merge 1 commit into
cgwire:mainfrom
tinnhcgi:fix/reply-avatar-enrich

Conversation

@tinnhcgi

@tinnhcgi tinnhcgi commented Aug 3, 2026

Copy link
Copy Markdown

Problem

When a reply is posted, everyone else in the conversation sees it appear with a broken avatar. Reloading the page fixes it.

UPDATE_COMMENT_REPLIES assigns comment.replies exactly as received. Raw replies only carry person_id, so the reply that arrives through the comment:reply realtime event never gets its author resolved. The POST response path goes through enrichCommentAuthors, which is why the author of the reply sees it render correctly and only the other participants see it break.

Fix

Call the same helpers.enrichCommentAuthors(comment) before assigning the replies. It already walks comment.replies, so no separate handling is needed.

Also return early when the comment is not in the local store — find() can return undefined and the next line dereferences it.

Notes

Reproduced on 1.0.55 and running with this patch in production since 2026-08-03: replies now render with the correct avatar immediately, no reload needed.

UPDATE_COMMENT_REPLIES assigned comment.replies as received. Raw replies only
carry person_id, so a reply arriving through the comment:reply event rendered
with a broken avatar until the page was reloaded; the POST response path went
through enrichCommentAuthors and looked fine, which is why it only showed up
for the other people in the conversation.

Run the same enrichment here, and bail out when the comment is not in the
local store instead of dereferencing undefined.
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.

1 participant