msasikanth / twine

Twine: A multiplatform RSS reader built using Kotlin and Compose
Apache License 2.0
1.71k stars 72 forks source link

Items not sorted (by publishing date) #427

Closed manum45 closed 3 months ago

manum45 commented 6 months ago

Describe the bug Items are not sorted by publishing date. It seems they are sorted by the time they were fetched by the client?

Device Information

msasikanth commented 6 months ago

Interesting, we are using publish dates for sorting and order it as latest first. Can you provide the link to feed you are having this issue with? It's possible it might be a date parsing issue.

vanniktech commented 6 months ago

@msasikanth from my experience there are also RSS Feeds that do not provide a pubDate at all 🤓

From my code:

// We insert all items in reverse order and with each insert ask for the current time.
// This is so that sorting (pubDate, updated) by time works even when the feed gives us no date.
// One such feed: https://www.csa.fi.it/cgi-bin/rss_eventi.pl?ambito=FI
msasikanth commented 6 months ago

@msasikanth from my experience there are also RSS Feeds that do not provide a pubDate at all 🤓

From my code:

// We insert all items in reverse order and with each insert ask for the current time.
// This is so that sorting (pubDate, updated) by time works even when the feed gives us no date.
// One such feed: https://www.csa.fi.it/cgi-bin/rss_eventi.pl?ambito=FI

Yeah, if there is no published date I fallback to current time when inserting.

manum45 commented 6 months ago

It seems to affect a lot feeds for me, for example this one: https://www.rockpapershotgun.com/feed From a quick look it appears to have publishing dates included.

msasikanth commented 6 months ago

It seems to affect a lot feeds for me, for example this one: https://www.rockpapershotgun.com/feed

From a quick look it appears to have publishing dates included.

Can you share the screenshot of the issue, please?

manum45 commented 6 months ago

Screenshot

msasikanth commented 6 months ago

Thanks. This is definitely a date parsing issue, will resolve it next update.

msasikanth commented 5 months ago

@manum45 want to check if this is still an issue in the latest version of the app?

manum45 commented 5 months ago

I'm on 1.43.0 and the issue still seems to be there. When I refresh all feeds it shows "0 min ago" for all articles.

23.05.2024 11:56:46 Sasikanth Miriyampalli @.***>:

@manum45[https://github.com/manum45] want to check if this is still an issue in the latest version of the app?

— Reply to this email directly, view it on GitHub[https://github.com/msasikanth/twine/issues/427#issuecomment-2126584131], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ADVLS7KG6BG4FQVOKBQLPJ3ZDWVM3AVCNFSM6AAAAABF3LNGYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRWGU4DIMJTGE]. You are receiving this because you were mentioned. [Verfolgungsbild][https://github.com/notifications/beacon/ADVLS7NAH3BL5HHNR2YFBGTZDWVM3A5CNFSM6AAAAABF3LNGYOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT6YEMUG.gif]

vanniktech commented 5 months ago

Yeah, if there is no published date I fallback to current time when inserting.

Are you doing this every single time? I only do it the very first time.

msasikanth commented 5 months ago

Yeah, if there is no published date I fallback to current time when inserting.

Are you doing this every single time? I only do it the very first time.

Yeah, I decided to update the feed contents rather than ignore them if they already exist, since some sources make changes. But I guess it's not that common and can safely be ignored.

rickdtc commented 4 months ago

I'm sorry if I don't make sense, quite new to rss feeds, but can't the fallback be sorting it sequentially based on what comes first on the xml file?

Gakai commented 4 months ago

Hi, another feed with the same issue: https://feeds.transistor.fm/postgres-fm For example the item "Intro to query optimization" from September '22 (and many other too) does indeed have a pubDate, but it still shows at the top with "0 min ago".

vanniktech commented 4 months ago

I also had this when I tried the app out to see how it's evolved. I added the Joe Rogan feed. It wasn't able to parse the dates and then everything was inserted reversed. So at the top was #1 instead of the latest one.

msasikanth commented 4 months ago

I will change the date parsing logic soon, hopefully that should resolve these issues. I already included tests for most common dates used in RSS feeds, but it looks like some of them are not getting properly parsed on Android.

vanniktech commented 4 months ago

You won't win this battle. I also still have some dates which I can't parse because they are simply wrong. Sometimes I get times like 13:00:60 (invalid seconds) or I get Monday, 06/22/2024 (wrong date of week name). I have over 150 different date formattings in my tests and still some of them I can't parse.

riumudutraz commented 3 months ago

The problem for me seems to be that every time I open the app it seems to fetch every single article as new, so I have always the old articles on top (the ones from the first day of use) and it says that every article was fetched "0 minutes ago" ☹️

rairmee commented 2 months ago

Hello. It still shows the fetching date in 1.47.1