Skip to content

fix: handle RSS guids with missing text content#691

Merged
bokelley merged 1 commit into
mainfrom
bokelley/fix-rss-guid-object
Jan 10, 2026
Merged

fix: handle RSS guids with missing text content#691
bokelley merged 1 commit into
mainfrom
bokelley/fix-rss-guid-object

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Fix TypeError when RSS feeds return guid elements with only attributes and no text content (e.g., Marketing Week's {"$":{"isPermaLink":"false"}})
  • Reduce RSS feed log volume by removing per-feed debug logs
  • Only log processing summary when there are new articles or errors

Changes

  • Update FeedItem.guid type to reflect optional _ (text content) and $ (attributes) properties
  • Improve guid extraction with explicit handling for all cases, falling back to article URL
  • Remove verbose debug logs while preserving error logging
  • Keep defensive String() coercion in generateSlug for safety

Test plan

  • TypeScript compiles without errors
  • All 187 tests pass
  • Tested with Docker: RSS feeds processed successfully with 0 errors

🤖 Generated with Claude Code

Some RSS feeds (e.g., Marketing Week) return guid elements with only
XML attributes but no text content, resulting in objects like
`{"$":{"isPermaLink":"false"}}` instead of strings. This caused
"Cannot convert object to primitive value" errors.

- Update FeedItem type to reflect optional `_` (text) and `$` (attrs)
- Extract guid text content properly, falling back to link URL
- Remove per-feed debug logs to reduce log volume
- Only log RSS processing summary when there are new articles or errors

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 1eb8271 into main Jan 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant