• Not using stock Docker compose setup
  • Can be reproduced on the official demo

Aside: the template text no longer seems to mention the login of username demo, password demo - I had to find that via searching older support posts. If intentional, that’s fine, just not sure if I missed something obvious.


Issue

After applying git commit 6fbf7ef368, custom feed icons are overwritten during regular feed updates every twelve hours (per favicon_last_checked) if the live feed has an icon present.

If favicons are marked as read-only (e.g. chmod 444 321.ico) to try to work around this, the system log instead prints a new warning entry every twelve hours, as expected.

To solve this problem, it might be necessary to add a per-feed flag indicating that a custom favicon has been set and it should not be overwritten during favicon checks. This flag would be set after successfully doing Upload new icon to set an icon, then cleared when removing the icon using the Remove option (so the live favicon will be re-downloaded next favicon check; might also need to set favicon_last_checked to the past).

Test case

Steps

  1. Add feed with valid icon
    • Example: https://www.androidpolice.com/feed/
  2. Edit the feed, setting a custom icon
    • Example: copy the icon from another feed, or use https://www.google.com/favicon.ico
  3. Confirm custom icon is applied
  4. Right-click feed, open Debug feed option
  5. On the debugging page, check Force refetch
    • This bypasses the 12 hour delay via if ($favicon_needs_check || $force_refetch) { … }
  6. Click Continue
  7. After fetch finishes, observe icon

Expected

Custom feed icon remains in place.

Actual

Custom feed icon gets overwritten by website’s live favicon.

Debug log prints the following:

[…]
[05:01:26/195] processing feed data...
[05:01:26/195] site_url: https://www.androidpolice.com
[05:01:26/195] feed_title: Android Police – Android news, reviews, apps, games, phones, tablets
[05:01:26/195] checking favicon for feed 12...
[05:01:27/195] setting contents of feed-icons/12.ico
[05:01:27/195] loading filters & labels...
[…]

Details

Versions

tt-rss version (including git commit id):
Tiny Tiny RSS v21.03-42e057c80

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:

  • OS: Ubuntu 20.04 LTS 64-bit
  • PHP: PHP 7.4.3
  • PostgreSQL: psql (PostgreSQL) 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)

Extra information

If this is deemed more effort than it’s worth, I’d appreciate a way to at least silence the warning message in the system log that gets added every twelve hours.

I subscribe to feeds for various folks on aggregator websites (e.g. Nitter to access Twitter, and multiple users on single Mastodon/Pleroma instances). Having custom icons helps distinguish between posts by different users on the same domain.

there’s some discussion here https://git.tt-rss.org/fox/tt-rss/pulls/6

my low-effort idea is making a .flag file (and removing it with the icon) i just need to find it in myself to implement it

Ack, pardon, despite searching here I didn’t think to check the git branch merge history for discussion there. Thank you! I see that the points I made were pretty much hashed out already.

A .flag file for icons sounds reasonable, too.

No rush from me; I don’t mind dealing with the system log warnings meanwhile.

https://git.tt-rss.org/fox/tt-rss/commit/e5469479c1ee6ddb671659dbb6362eac50f02979

post here if i broke something :slight_smile:

Thank you very much! That looks like a fine solution :smiley:

Issue noticed

Unfortunately, it seems a little bit broken at the moment - after updating, I got a bunch of notices in the system log and the favicon wouldn’t update.

From looking at the commit, it appears it might be something to do with $fetch_url needing to be replaced with $feed_obj->feed_url in…

$site_url = mb_substr(rewrite_relative_url($fetch_url, clean($rss->get_link())), 0, 245);

…line 622.

Reading around the commit, it seems like line 595 of classes/feeds.php might also need updated, not sure:

$feed_data, $fetch_url, $pff_owner_uid, $feed);

Likewise for line 836:

"fetch_url" => $fetch_url,

However, I’m making wild guesses in the hopes it may be helpful - feel free to disregard!

System logs

E_NOTICE (8)
classes/urlhelper.php:46
Undefined index: scheme
1. classes/urlhelper.php(46): ttrss_error_handler(8, Undefined index: scheme, classes/urlhelper.php, 46, [{"url":"","rel_url":"\/favicon.ico","rel_parts":{"path":"\/favicon.ico","host":null},"parts":{"path":""}})
2. include/functions.php(197): rewrite_relative(, /favicon.ico)
3. classes/rssutils.php(1936): rewrite_relative_url(, /favicon.ico)
4. classes/rssutils.php(1724): get_favicon_url()
5. classes/rssutils.php(640): check_feed_favicon(, 461)
6. classes/feeds.php(682): update_rss_feed(461, 1)
7. backend.php(133): updatedebugger()

Remote IP: 2600:6c5e:[redacted]
Request URI: /app/tt-rss/backend.php
User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0 	digitalcircuit 	4:03 am
E_NOTICE (8)
classes/urlhelper.php:45
Undefined index: host
1. classes/urlhelper.php(45): ttrss_error_handler(8, Undefined index: host, classes/urlhelper.php, 45, [{"url":"","rel_url":"\/favicon.ico","rel_parts":{"path":"\/favicon.ico"},"parts":{"path":""}})
2. include/functions.php(197): rewrite_relative(, /favicon.ico)
3. classes/rssutils.php(1936): rewrite_relative_url(, /favicon.ico)
4. classes/rssutils.php(1724): get_favicon_url()
5. classes/rssutils.php(640): check_feed_favicon(, 461)
6. classes/feeds.php(682): update_rss_feed(461, 1)
7. backend.php(133): updatedebugger()

Remote IP: 2600:6c5e:[redacted]
Request URI: /app/tt-rss/backend.php
User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0 	digitalcircuit 	4:03 am

oops, missed a few while search and replacing

unless someone files a pr I’ll fix it when I’m home in a few hours

All seems to be working fine now, thank you very much!

I appreciate the effort spent to preserve the custom icon feature even though it doesn’t seem to be widely used. And having non-custom icons auto-update is nicer than how this worked previously. :slightly_smiling_face: