When merging duplicate feeds with redirects, Follow relationships
can generate UNIQUE constraint errors if the relationship already
exists between the same profiles.
This fix:
- Iterates Follow relationships individually
- Checks for existing relationships before updating
- Deletes duplicates safely
- Adds comprehensive error handling
Similar approach to PollVote fix.
Resolves issue with feeds like haiverin.scot redirect.
Signed-off-by: Andros Fenollosa <hi@andros.dev>
This commit implements automatic cleanup of feeds that haven't been successfully fetched in 3 days.
Changes:
- Add last_successful_fetch field to Feed model to track when feeds are successfully fetched (HTTP 200)
- Update parse_org_social() and validate_org_social_feed() to record successful fetches
- Add new periodic task cleanup_stale_feeds() that runs every 3 days and deletes inactive feeds
- Add comprehensive test suite (9 tests, all passing)
- Migration safely handles existing feeds by setting initial last_successful_fetch to protect them
Safety features:
- Feeds with last_successful_fetch = NULL are never deleted (protects legacy feeds)
- Only feeds older than 3 days are deleted
- Extensive logging of cleanup operations
- Initial migration sets timestamp for all existing feeds to prevent accidental deletion
🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Updated parser to accept #+title:, #+nick:, #+description: (lowercase)
- Added re.IGNORECASE flag to all metadata parsing regex patterns
- Fixes validation issues with feeds using lowercase keywords
- Enables registration of feeds like codeberg.org that use lowercase format