From 0302cea523a89a2dd932ff96546c267520a5eb19 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 03:32:25 +0000 Subject: [PATCH] Post Epic free games on first run instead of silently recording them On first startup, _populate_initial_state() was marking current Epic free games as "posted" without actually sending them to the room. This meant users had to wait until the next cycle of new games before seeing anything. Now only CheapShark deals are silently recorded on first run (there can be dozens). Epic free games are left for check_epic_free_games() to pick up and post immediately, since they are few in number and time-limited. https://claude.ai/code/session_017eMsVwUopgmnEyd6JJedpV --- gaming_deals_bot/bot.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gaming_deals_bot/bot.py b/gaming_deals_bot/bot.py index 9629660..657c005 100644 --- a/gaming_deals_bot/bot.py +++ b/gaming_deals_bot/bot.py @@ -53,7 +53,13 @@ class DealsBot: await self.db.close() async def _populate_initial_state(self): - """Fetch current deals and record them without posting (avoids spam on first run).""" + """Fetch current CheapShark deals and record them without posting (avoids spam on first run). + + Epic free games are intentionally *not* recorded here so that the + subsequent ``check_epic_free_games`` call will post them. There are + only a handful at any time and they are time-limited, so users should + see them immediately rather than waiting for the next cycle. + """ deals = await fetch_deals( self._http, max_price=self.config.max_price_usd, @@ -63,14 +69,7 @@ class DealsBot: for deal in deals: await self.db.mark_posted(deal.dedup_id, "cheapshark", deal.title) - current_free, upcoming = await fetch_free_games(self._http) - for game in current_free: - await self.db.mark_posted(game.dedup_id, "epic", game.title) - for game in upcoming: - await self.db.mark_posted(game.dedup_id, "epic", game.title) - - total = len(deals) + len(current_free) + len(upcoming) - logger.info("First run: recorded %d existing deals/games", total) + logger.info("First run: recorded %d existing CheapShark deals", len(deals)) async def send_intro(self): """Send an intro message to the Matrix room if configured."""