Skip to content

Conversation

@ilyatitovich
Copy link
Contributor

@ilyatitovich ilyatitovich commented Jan 20, 2026

  • Added dedupeLinks function to ensure that feed links differing only by protocol are not duplicated;
  • Added a test.

Motivation

When a user provides an HTTP URL, the fetched HTML may reference the same feed using both absolute HTTPS links and relative links resolved from the HTTP page. This resulted in duplicate feed candidates being returned.

Note

For manual testing, you can use this page. It contains three potential feeds that would appear as duplicates if you use HTTP without this fix.

@ai
Copy link
Contributor

ai commented Jan 20, 2026

This change is also very welcome, but #219 was about another issue:

  1. A year ago you subscribed to http://exler.ru
  2. Now website was moved to https://exler.ru
  3. You are typing https://exler.ru to add page, but feedPopup.feed is undefined (UI shows that you was not subscribed to the feed)

But don't close this PR, it is also nice UX touch. We need it as well (I will review it tomorrow).

@ilyatitovich
Copy link
Contributor Author

Maybe I misunderstood, but I remember how I found this small bug. We discussed it on Discord: if you open a site via HTTP, the feed link extracted from the anchor appears in the list as http, creating a duplicate of the same link that already exists as https. So I assumed that only this behavior needed to be fixed.

Now I need to think about this subscription issue 😀

@ilyatitovich
Copy link
Contributor Author

I think I see the core issue now.

We use the feed URL itself as the filter key, and createFilter() relies on strict equality when querying IndexedDB. Because of that, http and https URLs are treated as different feeds.

The clean solution would be to introduce a normalized identifier (like a feedKey URL without protocol), but I understand that this would require a schema update and data migration.

As a simpler workaround without schema changes, we could try checking the feed with https first, and if nothing is found, fall back to http. This would keep existing subscriptions working after an httphttps move.

@ai
Copy link
Contributor

ai commented Jan 22, 2026

As a simpler workaround without schema changes, we could try checking the feed with https first, and if nothing is found, fall back to http. This would keep existing subscriptions working after an http → https move.

Or we can first check exact URL and on nothing found, make another check with other (https →  http, httphttps).

@ai ai merged commit 44644c7 into hplush:main Jan 22, 2026
7 checks passed
@ai
Copy link
Contributor

ai commented Jan 22, 2026

Thanks for UX improvment

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