Skip to content

fix(rss): deliver unseen items published before the last poll - #7792

Merged
TheodoreSpeaks merged 1 commit into
stagingfrom
codex/fix-rss-poll-delivery
Sep 11, 2026
Merged

fix(rss): deliver unseen items published before the last poll#7792
TheodoreSpeaks merged 1 commit into
stagingfrom
codex/fix-rss-poll-delivery

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

RSS polling advances lastCheckedTimestamp on every poll and rejects items published before that timestamp, even when their GUID has never been delivered. A feed that exposes a 21:25 article after a 23:26 poll therefore silently loses it. Staging native canaries exposed this while the poller itself continued reporting success.

Use the subscription's immutable webhook creation time as the historical cutoff and retain GUID deduplication. This accepts delayed feed entries without replaying known GUIDs or backfilling items published before subscription. This patch is limited to the timestamp filter; the separate attempted-versus-delivered bookkeeping issue is deferred.

Type of Change

  • Bug fix

Testing

  • New delayed-item regression test fails on the original implementation and passes with the fix.
  • RSS, IMAP, and polling-state tests: 14 passed.
  • App bun run type-check: passed.
  • bun run check:api-validation: passed.
  • Biome checks and git diff --check: passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 11, 2026 11:51pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR should not merge until RSS deduplication remains effective for the full history admitted by the new subscription-time cutoff.

Findings

  1. P1 Old Entries Can Replay

Summary

  • Retains GUID-based filtering for known entries.
  • Adds regression coverage for delayed entries, changed publication dates, and pre-subscription history.
  • The broader timestamp window can replay previously delivered entries after bounded GUID history and temporary idempotency records expire.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Poll RSS feed] --> B{GUID in latest 500?}
  B -->|Yes| C[Skip item]
  B -->|No| D{Published after subscription?}
  D -->|No| C
  D -->|Yes| E{Idempotency record active?}
  E -->|Yes| C
  E -->|No| F[Deliver item]
  F --> G[Prepend GUID and truncate history to 500]
  G --> H[Older GUID may be evicted]
  H --> A
Loading

Reviews (1) · Last reviewed commit: "fix(rss): deliver unseen items published..."

if (itemDate <= lastCheckedTime) {
if (itemDate <= subscriptionStartedAt) {
return false
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Old Entries Can Replay

If a feed retains an item after its GUID falls out of the 500-entry lastSeenGuids window, this subscription-time cutoff allows that already-delivered item through again because its publication date remains after the subscription began. The idempotency key expires after three days, so feeds containing more than 500 retained items can cause old entries to be delivered repeatedly. Deduplication needs to remain durable for every item admitted by this broader timestamp window.

@TheodoreSpeaks
TheodoreSpeaks merged commit 9d7557a into staging Sep 11, 2026
34 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