Skip to content

Stop Thunder from burying undeleted in-network posts - #68

Closed
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/magellan-wave2-undelete-4eaf
Closed

Stop Thunder from burying undeleted in-network posts#68
Pitchfork-and-Torch wants to merge 19 commits into
mainfrom
cursor/magellan-wave2-undelete-4eaf

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

Bug

Thunder delete has a handler. Thunder undelete does not. A restored followee tweet stays off For You until the tombstone ages out.

Five-line proof

  1. TweetDeleteEvent removes the CompactPost and inserts post_id into deleted_posts.
  2. Live Thrift union includes TweetUndeleteEvent with the same tweet/user payload as create.
  3. Feeder match fell through to _ => {}, so no InNetworkEvent was emitted.
  4. Serving insert_posts refused any later create for a tombstoned id (if deleted_posts.contains_key { continue }).
  5. GetInNetworkPosts therefore omitted the restored tweet for up to the retention window.

Twin: delete is handled; undelete is not. This is not xai-org#138 (QuotedTweetDelete kills the quote) and not xai-org#150 (RT of a tombstoned original).

Fix

  • Feeder maps TweetUndeleteEvent through the same LightPost builder as create (nullcast still skipped) and emits TweetCreateEvent.
  • Store clears the tombstone on re-insert. If the author deque still holds the ghost id, do not push a second index row.

Tests

  • undelete_clears_tombstone_and_restores_post (fails on unmodified main)
  • Undelete maps to the same LightPost as create
  • Nullcast undelete is skipped like create

cargo: cannot run. Public dump has no Thunder manifest.

Rejection table (this wave)

Candidate Why not
OON followee RT via stale in_network Same class as xai-org#128/xai-org#154/xai-org#183
VF author_blocks_viewer missing Live For You uses BlockedByHydrator; Following leak is xai-org#108
RT originals scored at TimelineHome xai-org#116 closed; xai-org#119 covers original verdicts
Author handle mute keyword xai-org#182 claimed
Topic snooze untagged xai-org#170 claimed
SidTail / PopularTopics / BroadcastLiveness enable Forbidden intern-enable
Author-size IPS Forbidden
Home-mixer TES/gizmoduck/VF fail-closed spray Forbidden
Open in Web Open in Cursor 

CI agent and others added 19 commits August 14, 2026 20:55
in_network_ids is passed to the VF client without deduplication, while
oon_ids is deduped four lines below. retweeted_tweet_id is pushed for
every candidate that has one, so the same ID repeats once per retweet of
a given post — most often when that post is going viral.

Neither VfClient implementation dedupes its input: StratoVfClient builds
one call per element, and XaiVfClient chunks by XAI_VF_MAX_BATCH_SIZE, so
duplicates consume batch slots and can force an extra round trip.

Not a correctness issue — results collapse into a HashMap keyed by tweet
ID — but redundant work on the For You serving path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deduplicate in_network_ids before VF lookup
TweetUndeleteEvent was dropped on the feeder, and insert_posts refused
tombstoned ids, so a restored tweet stayed off For You until retention
trim. Handle undelete like create and clear the tombstone on re-insert.

Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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.

4 participants