[tasks] Resolve reply authors when a realtime reply arrives - #2168
Open
tinnhcgi wants to merge 1 commit into
Open
[tasks] Resolve reply authors when a realtime reply arrives#2168tinnhcgi wants to merge 1 commit into
tinnhcgi wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_REPLIESassignscomment.repliesexactly as received. Raw replies only carryperson_id, so the reply that arrives through thecomment:replyrealtime event never gets its author resolved. The POST response path goes throughenrichCommentAuthors, 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 walkscomment.replies, so no separate handling is needed.Also return early when the comment is not in the local store —
find()can returnundefinedand 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.