Bug 3429 - Faulty logic in rssyl_cb_feed_compare in regards to item url?
Summary: Faulty logic in rssyl_cb_feed_compare in regards to item url?
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/RSSyl (show other bugs)
Version: 3.11.1
Hardware: All All
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2015-05-18 23:12 UTC by Nick Koretsky
Modified: 2017-11-03 19:12 UTC (History)
0 users

See Also:


Attachments
Modifies rssl_cb_feed_compare() (2.88 KB, patch)
2015-05-23 20:55 UTC, Andrej Kacian
no flags Details | Diff

Description Nick Koretsky 2015-05-18 23:12:10 UTC
Examining rssyl_cb_feed_compare logic, it looks like if an items urls differ ( (no_url || url_eq) is false ) it would return 1 (items differ) irregardless of all other factors which i think is wrong. I would say (date_eq && title_eq) is pretty good indicator of the same (changed) item. Current behavior breaks silent_updates on feeds where urls can change.
Comment 1 Andrej Kacian 2015-05-23 20:55:55 UTC
Created attachment 1509 [details]
Modifies rssl_cb_feed_compare()

This comparing logic is something that's been bothering me for a while, but never got around to coming back to.

Can you try attached patch to see if it works better for you? It fixes at least one bug that I sometimes see on certain feeds, while not breaking anything so far.
Comment 2 Nick Koretsky 2015-05-23 23:04:24 UTC
Well, i will try it, but at first glance it still misses (date_eq && title_eq) as match...


Also i have already played with rssyl_cb_feed_compare (which didnt work initially), and after adding a lot of debug output i realized that it didnt match anything because rssyl_expire_items was removing old copy in rssyl_parse_feed before things even get to rssyl_add_item. I cant comprehend the logic behind rssyl_expire_items at all, fortunately there is keep_old option on feeds which saved me from that problem, but i am not sure that is an intended behavior...
Comment 3 Andrej Kacian 2015-05-23 23:44:33 UTC
That is not true, rssyl_expire_items() is called only *after* rssyl_add_items() is called for each item in rssyl_parse_feed().

The (date_eq && title_eq) can be added to the compare logic, I guess, although we are getting into a fuzzy area there, in my opinion. Oh, how I wish permanent unique IDs were mandatory in rss/atom specs!
Comment 4 Andrej Kacian 2015-05-23 23:45:21 UTC
...it should read "rssyl_add_item()", not "rssyl_add_items()" in my previous comment, sorry.
Comment 5 Nick Koretsky 2015-05-24 00:19:03 UTC
Well, this entire quest for me started with a feeds from a site were urls in old items change randomly (site have multiple domain names and it looks like it returns a random one on each read), so i cant live without (date_eq && title_eq) :)

> That is not true, rssyl_expire_items() is called only *after* >rssyl_add_items() is called for each item in rssyl_parse_feed().

Um, are you really sure about this? because in the logs it looked the other way around and switching keep_old to 1 instantly fixed the problem. (I had half of the items on this feeds turning blue daily). I didnt kept the logs but if you wish i can turn off keep_old and send you a new ones.
Comment 6 Nick Koretsky 2015-05-24 00:45:29 UTC
Disregard the previous comment, you are right. I feel stupid :( . Probably forgot to restart claws or copy newly compiled rssyl at one point during my experiments and got wrong idea...
Comment 7 users 2015-06-04 09:17:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2015-06-04 09:17:02.186895405 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=6cff19e9ab0f14a098eb9a46c998f9e281aa668e
Merge: d3e4de0 1114a38
Author: Colin Leroy <colin@colino.net>
Date:   Thu Jun 4 09:17:01 2015 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=1114a38f3890f45e48285f35695ade33e30c3c82
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sat May 23 20:56:35 2015 +0200

    RSSyl: Reworked item comparing logic, partly based on bug #3429.

Note You need to log in before you can comment on or make changes to this bug.