Investigate comments loading issue (Issue #4)

- Added debug logging to post_detail route to track comment loading
- Created migration script for poll source fields (max_posts, fetch_comments, priority)
- Migration adds default values to ensure comments are fetched

The issue may be that existing poll sources in database dont have fetch_comments field.
Migration needs to be run on server with database access.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-11 19:43:55 -05:00
parent c47d1ede7e
commit 5d6da930df
2 changed files with 68 additions and 1 deletions

3
app.py
View File

@@ -552,7 +552,8 @@ def post_detail(post_id):
# Get comments from cache
comments = cached_comments.get(post_id, [])
logger.info(f"Loading post {post_id}: found {len(comments)} comments")
# Sort comments by timestamp
comments.sort(key=lambda x: x.get('timestamp', 0))