Skip to content

I asked ChatGPT whether to be a hardass about item-level guids #11

@scripting

Description

@scripting

ChatGPT is good for finding out about best practice in RSS-based feed readers.

I asked this question:

my reader depends on <guid> for identity. should we not enter those items in the database? obviously we can't handle updates for those items, how would we know which one to update. should we reject items with no guid?

ChatGPT's sage advice

Short answer: No — you should NOT reject RSS items that have no <guid>.
Instead, create a stable synthetic ID for them.

Why you can’t reject items without GUIDs

  • RSS 2.0 makes <guid> optional.
  • Many real-world feeds omit it.
  • Rejecting those items would make your reader silently drop valid posts.

Recommended identity strategy

Use a stable item key, with fallbacks:

  1. If <guid> exists:
    Use (feedId, guidValue) as the identity.

  2. Else if <link> exists:
    Use (feedId, normalizedLink) as the identity.

    • Normalize: lowercase host, strip trailing slashes, handle http/https if you choose.
  3. Else (no guid, no link):
    Use a synthetic hash such as:
    hash(title + pubDate + description)
    This is rare and imperfect, but better than discarding the item.

Handling updates

  • Items with a GUID: updates are easy — overwrite based on (feedId, guid).
  • Items with only a link: treat (feedId, link) as the stable key and update on repeats.
  • Synthetic-hash items: generally treat repeats as new items; reliable updates aren’t possible.

Best practice summary

  • Do not reject items with no GUID.
  • Store them using the fallback identification rules above.
  • Accept that updates will be imperfect for a small number of feeds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions