Skip to content

fix: visited state broken for feeds with whitespace in links - #97

Merged
strdr4605 merged 1 commit into
masterfrom
fix-visited
Feb 26, 2026
Merged

fix: visited state broken for feeds with whitespace in links#97
strdr4605 merged 1 commit into
masterfrom
fix-visited

Conversation

@strdr4605

Copy link
Copy Markdown
Member

Bug

Some RSS feeds (e.g. https://antirez.com/rss) include surrounding whitespace/newlines in their <link> elements:

<link>
http://antirez.com/news/158
</link>

FeedSection correctly filters using item.link.trim(), so visited items are excluded from the new items list. However, when storing the visited key, item.link was used without trimming — causing a key mismatch. The stored key was \nhttp://antirez.com/news/158\n but the lookup key was http://antirez.com/news/158, so items were never considered visited.

Fix

.trim() the link when storing the visited key in onLinkClick, markAllAsVisited, and markVisitedInCache — consistent with the existing .trim() in the filter.

Test

Added an e2e test in persistence.spec.ts that reproduces the bug using a mock feed with whitespace-padded <link> tags.

Some RSS feeds (e.g. antirez.com) include surrounding whitespace/newlines
in <link> tags. FeedSection filters with item.link.trim() but visited keys
were stored without trimming, causing a mismatch and visited state never
being applied.
@strdr4605
strdr4605 merged commit 8721f0d into master Feb 26, 2026
3 checks passed
@strdr4605
strdr4605 deleted the fix-visited branch February 26, 2026 09:02
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