Repository navigation
fix(home-mixer): preserve ancestor and parent context for reply notifications (#205) - #219
Open
Adityakk9031 wants to merge 1 commit into
Open
Adityakk9031 wants to merge 1 commit into
Adityakk9031 wants to merge 1 commit into
Conversation
…ications (xai-org#205) - In push_to_home_marshaller, ensure the direct parent tweet (in_reply_to_tweet_id) is included in module_items alongside the root tweet, preventing replies opened via notifications from rendering in isolation as orphaned posts. - In convo_marshaller, fall back to in_reply_to_tweet_id when ancestors is empty so conversation modules always render parent context. - In urt/mod.rs and reverse_chron_following/mod.rs, check post.in_reply_to_tweet_id == 0 before routing to marshal_post to prevent replies from being marshaled as standalone posts. - In core_data_candidate_hydrator, populate candidate.ancestors and ancestor_users when in_reply_to_tweet_id is present on core_data. - Add unit tests for push_to_home_marshaller and convo_marshaller.
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.
Summary
Fixes #205
Resolves an issue where opening a reply notification (or timeline requests with push-to-home focal replies) marshals the reply in isolation as an orphaned post, completely omitting the parent post being responded to.
Root Cause Analysis
push_to_home_marshaller.rs):PushToHomePostholds bothconversation_id(root) andin_reply_to_tweet_id(direct parent).push_to_home_marshaller,in_reply_to_tweet_idwas checked solely to setis_root, but was never added tomodule_items.root(fromconversation_id) was added. Ifconversation_id == 0or equaled the reply ID,rootwasNoneandmodule_itemsonly contained the isolated focal reply.root -> parent -> reply), onlyrootwas rendered and the immediate parent being responded to was completely omitted from the rendered items.convo_marshaller.rs):convo_marshaller, if a post'sancestorsarray was empty,parent_tweetswas empty, resulting initem_idscontaining only[focal_id].urt/mod.rs&reverse_chron_following/mod.rs):post.ancestors.is_empty()routed replies topost_marshaller::marshal_post(a standalone post) without checkingpost.in_reply_to_tweet_id == 0.core_data_candidate_hydrator.rs):in_reply_to_tweet_id,candidate.ancestorswas not populated, leaving replies vulnerable to orphan marshalling and premature filter dropping inOONRetweetReplyFilter.Changes Made
home-mixer/util/urt/push_to_home_marshaller.rs:parent(post.in_reply_to_tweet_id) inmarshal_push_to_home.module_itemsin hierarchical order:[root_id, parent_id, focal_id](deduping ifroot == parent), ensuring the parent post is always rendered above the reply.conversation_id.home-mixer/util/urt/convo_marshaller.rs:post.in_reply_to_tweet_idwhenpost.ancestorsis empty so conversation modules always render parent context.home-mixer/util/urt/mod.rs&reverse_chron_following/mod.rs:post.in_reply_to_tweet_id == 0before routing topost_marshaller::marshal_post.home-mixer/candidate_hydrators/core_data_candidate_hydrator.rs:candidate.ancestorsandancestor_userswhenin_reply_to_tweet_idis present oncore_data.