a digital entity named phi that roams bsky

Fix notification polling output timing

- Track first poll to show initial notification state
- Only print dots on subsequent polls with no new mentions
- Prevent dots from appearing before FastAPI startup
- Show notification count on first poll, then only changes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Changed files
+12 -8
src
bot
+12 -8
src/bot/services/notification_poller.py
··· 14 14 self._task: asyncio.Task | None = None 15 15 self._last_seen_at: str | None = None 16 16 self._processed_uris: set[str] = set() # Track processed notifications 17 + self._first_poll = True # Track if this is our first check 17 18 18 19 async def start(self) -> asyncio.Task: 19 20 """Start polling for notifications""" ··· 63 64 response = await self.client.get_notifications() 64 65 notifications = response.notifications 65 66 66 - if not notifications: 67 - return 68 - 69 - # Just print a dot to show activity without spamming 70 - print(".", end="", flush=True) 71 - 72 67 # Count unread mentions 73 68 unread_mentions = [ 74 69 n for n in notifications if not n.is_read and n.reason == "mention" 75 70 ] 76 - # Only print if we actually have unread mentions 77 - if unread_mentions: 71 + 72 + # First poll: show initial state 73 + if self._first_poll: 74 + self._first_poll = False 75 + if notifications: 76 + print(f"\n📬 Found {len(notifications)} notifications ({len(unread_mentions)} unread mentions)") 77 + # Subsequent polls: only show activity 78 + elif unread_mentions: 78 79 print(f"\n📬 {len(unread_mentions)} new mentions", flush=True) 80 + elif notifications: 81 + # Only print dots if we're actually checking notifications 82 + print(".", end="", flush=True) 79 83 80 84 # Track if we processed any mentions 81 85 processed_any_mentions = False