Skip to content

feat: use feed entry id as fallback link.#1144

Merged
spacecowboy merged 1 commit into
spacecowboy:masterfrom
fictiontoreality:entry-id-as-fallback-link
May 19, 2026
Merged

feat: use feed entry id as fallback link.#1144
spacecowboy merged 1 commit into
spacecowboy:masterfrom
fictiontoreality:entry-id-as-fallback-link

Conversation

@fictiontoreality

@fictiontoreality fictiontoreality commented May 19, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Some RSS feeds store entry links in the <id> field rather than in a separate <link> field. Example: https://jacobin.com/feed

...
<entry>
  <id>https://jacobin.com/2026/05/democrats-medicare-for-all-donor-class</id>
...

This change takes advantage of this by:

  1. if <link> field is present, use that as the link.
  2. if not, check if the <id> field is a valid absolute HTTP/S URL, and if so use that as the link.

Checklist

  • Ran ./gradlew ktlintFormat and committed the result
  • If the Room schema changed: added a MIGRATION_N_N+1 in AppDatabase.kt
  • If the Room schema changed: added a migration test in app/src/androidTest/.../db/room/

Screenshots (if UI change)

N/A

Some RSS feeds store entry links in the <id> field rather than in a separate
<link> field.

This change takes advantage of this by:
1. checking if <link> field is present.
2. if not, check if the <id> field is a valid HTTP/S URL, and if so use that as
as the link.
@spacecowboy

Copy link
Copy Markdown
Owner

thanks @fictiontoreality . Normally I'd say that we shouldn't cater to such incorrect feeds, but the code is clean and is covered by tests so 👍

@spacecowboy spacecowboy merged commit 698b884 into spacecowboy:master May 19, 2026
12 checks passed
jenningsloy318 pushed a commit to jenningsloy318/Feeder that referenced this pull request May 29, 2026
Some RSS feeds store entry links in the <id> field rather than in a separate
<link> field.

This change takes advantage of this by:
1. checking if <link> field is present.
2. if not, check if the <id> field is a valid HTTP/S URL, and if so use that as
as the link.
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.

2 participants