From dfa9a973e752ab7527f100ed5fbd9491f93144f8 Mon Sep 17 00:00:00 2001 From: Pritesh-30 Date: Wed, 17 Dec 2025 02:04:34 +0530 Subject: [PATCH] rss_bot: Handle oldest-first RSS feeds correctly. This change ensures the bot continues scanning the entire feed so all new entries are detected regardless of feed order,so new feeds are not missed. Fixes #831. --- zulip/integrations/rss/rss-bot | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/zulip/integrations/rss/rss-bot b/zulip/integrations/rss/rss-bot index 49c82fb62..b25fcbca6 100755 --- a/zulip/integrations/rss/rss-bot +++ b/zulip/integrations/rss/rss-bot @@ -234,13 +234,14 @@ for feed_url in feed_urls: # entries older than some threshold. continue if entry_hash in old_feed_hashes: - # We've already seen this. No need to process any older entries. - break - if not old_feed_hashes and len(new_hashes) >= 3: - # On a first run, pick up the 3 most recent entries. An RSS feed has - # entries in reverse chronological order. - break + # We've already processed this entry; skip it but continue scanning + # the feed, since entries may not be ordered newest-first. + continue + if not old_feed_hashes and len(new_hashes) >= 3: + # On a first run, limit how many entries we post, but continue scanning + # the feed to record newer entries that may appear later. + continue feed_name: str = data.feed.title or feed_url response: Dict[str, Any] = send_zulip(entry, feed_name)