Skip to content

Fix initial content flood on new source subscription#192

Merged
user1303836 merged 1 commit intomainfrom
fix/initial-content-flood
Feb 7, 2026
Merged

Fix initial content flood on new source subscription#192
user1303836 merged 1 commit intomainfrom
fix/initial-content-flood

Conversation

@user1303836
Copy link
Owner

Summary

  • Fixes a bug where subscribing to a new source (Twitter, Substack, RSS, etc.) would flood the Discord channel with all pre-existing content on the second poll cycle
  • On first poll, all fetched items are now stored in the database but immediately marked as backfilled (except the most recent), preventing re-discovery on subsequent polls
  • The existing _handle_first_posting_backfill safety net in summarize_pending is retained as a secondary defense

Root Cause

The previous approach stored only 1 item on first poll then broke out of the loop. On the next poll cycle, the adapter would return the same batch of items. The 1 already-stored item was skipped, but all remaining items were treated as new content and posted to Discord.

Test plan

  • test_first_poll_stores_all_items_and_backfills - verifies all items stored and backfill called
  • test_first_poll_no_backfill_when_single_item - verifies single-item first poll works correctly
  • test_subsequent_poll_stores_all_new_items - verifies non-first polls unchanged
  • All 597 existing tests pass
  • ruff check, ruff format, mypy all clean

On first poll, store all fetched items in the database but immediately
mark all except the most recent as backfilled. This prevents old items
from being re-discovered and posted on subsequent poll cycles.

Previously, first poll stored only 1 item and broke out of the loop.
On the second poll, the remaining items were treated as new content
and flooded the Discord channel.
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@user1303836 user1303836 merged commit 554e8db into main Feb 7, 2026
4 checks passed
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