Ashinch / ReadYou

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

Unread feeds page does not refresh with new items once sync is complete #408

Open mbestavros opened 1 year ago

mbestavros commented 1 year ago

1. Environment

2. Describe the bug

When a new article comes in to a feed that has all its prior articles read, the unread feeds page UI does not show the feed at all until the user switches away to a different view and then back.

You should be able to reproduce by synchronizing the app, then marking an item as unread in a category without any other read items on a different device, then synchronizing again. The article's feed won't show up in the Unread page. Interestingly enough, it does appear once I switch filters away from Unread and back again. (NOTE: the "marking articles as unread" process to reproduce may require #406.)

It also occurs when the app is set to "sync once on start" and the launch page is set to unread feeds.

This was tested on the Fever API, but from digging it seems like it might be an issue with all providers.

Notes

This is a UI bug, and I have pretty much no experience with UI. I've toyed around with it a bit, but I don't think I have the know-how to create a patch.

It does seem as though invoking feedsViewModel.pullFeeds(filterUiState) within FeedsPage.kt does refresh the UI correctly; it's just a matter of invoking that call once sync finishes, both from a manual sync and when syncing on first open.

Calling the code on sync finish is the challenging bit. Since syncing is invoked as a coroutine/background task (as it should be), invoking code once it finishes involves deeper knowledge of Android's WorkManager and coroutines than I have. I think this would benefit from developer attention.

mbestavros commented 1 year ago

Here's a screen recording of the issue:

https://github.com/Ashinch/ReadYou/assets/10786787/aea74fd4-0dfb-47b6-bb79-27668f22dec0