Ashinch / ReadYou

An Android RSS reader presented in Material You style.
GNU General Public License v3.0
4.82k stars 188 forks source link

"Keep Archived Articles" setting does not delete archived articles from the database when connected to Miniflux #707

Closed mbestavros closed 2 months ago

mbestavros commented 4 months ago

1. Environment

2. Describe the bug

When Read You is connected to Miniflux via the Greader API and the "Keep Archived Articles" setting is not "Always", the app fails to clear old articles from the database.

Expected behavior

When "Keep Archived Articles" is set to e.g. 7 days, articles older than 7 days should be deleted from the app's database.

Actual behavior

Articles are retained indefinitely, regardless of the "Keep Archived Articles" setting, causing the database to balloon in size and negatively impact the app's performance.

mbestavros commented 4 months ago

I opened #702 as a first attempt to fix this bug. It turns out that it's deeper than anticipated: Miniflux and FreshRSS send different timestamp values for articles, causing the unexpected behavior. FreshRSS sends the crawlTimeMsec and timestampUsec parameters at different precision, as documented here. Miniflux, on the other hand, sends timestamps for both values at microsecond precision regardless (see here). This means that Read You assumes that crawlTimeMsec is millisecond precision when it's actually provided in microsecond precision. That causes the app to think that articles are actually dated about 50,000 years into the future, and therefore they never get deleted.

We should probably follow up with Miniflux upstream for now, but if that doesn't work, we may want to consider some kind of workaround.

EDIT The Miniflux issue is here: https://github.com/miniflux/v2/issues/2669

mbestavros commented 4 months ago

Miniflux upstream has fixed the issue in https://github.com/miniflux/v2/pull/2673!

I'm going to keep this issue open for now, until the fix rolls out to Miniflux stable and I'm able to test it. Once I've verified that it's fixed, I'll close this issue.

mbestavros commented 2 months ago

https://github.com/miniflux/v2/releases/tag/2.1.4 includes the fix from https://github.com/miniflux/v2/pull/2673!

I tested the release with Read You, and archived articles now get deleted as expected. Hooray! Closing this issue.