You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core+event+domain: drop broken parent_id-as-user-id routing in replies
parent_id is a TWEET id, not a user id (it selects which subtree of
replies inside a thread to return). The existing StreamGetRepliesHandler
treated it as a user id:
isOwnTweetReplies := parentId == streamer.NodeInfo().OwnerId
parentUser, err := userRepo.Get(parentId)
Both were always false / always ErrUserNotFound, so the handler
silently fell through to the local cache for every request. Removed
the dead remote-routing path; the handler now serves replies
straight from the local repo. Empty parent_id is still normalised to
root_id (top-level replies of the thread).
Proper remote-fetch routing would require a RootUserId field in
GetAllRepliesEvent so we know which node to forward to — out of scope
here; clients fall back to whatever replies they've already cached
from gossip / earlier fetches.
Also annotated GetAllRepliesEvent, NewReplyEvent, and domain.Tweet
with comments calling out that ParentId is a tweet id, so this
mistake doesn't get re-introduced.
Tests: dropped the now-impossible "parent user not found / stream
offline / remote success" cases (the handler no longer touches a
streamer or user repo) and added a "propagates repo error" case.
0 commit comments