nextcloud / news-android

📱🗞️ Android client for the Nextcloud news/feed reader app
https://play.google.com/store/apps/details?id=de.luhmer.owncloudnewsreader
GNU Affero General Public License v3.0
699 stars 257 forks source link

Synchronisation of read articles across multiple devices is not reliable #1378

Open smilingj opened 10 months ago

smilingj commented 10 months ago

I use the app on two devices (Samsung Galaxy A71 and Galaxy Tab A8). When I read articles on one device and then want to read more unread articles on the other device, I often get articles that I have already read on the first device displayed again as new.

In the Nextcloud backend, the affected articles are correctly marked as read. Emptying the cache on the second device reliably helps, then the status is synchronised again.

This is feasible, but no good user experience. I thought about always emptying the cache as soon as the app is displayed. This seems a bit aggressive to me, but should solve my specific problem.

Now the question is whether I have a wrong configuration of the app or whether this is a general problem.

Is there anything I can provide additionally to my description?

David-Development commented 10 months ago

Is the nextcloud news server app up to date? Which versions do you have installed where (nextcloud version, nextcloud news version, nextcloud news android app version, android os version).

How the sync works:

I can't think of a case where this wouldn't work. If you say that they are showing up as read in the web app that means that the state has been synced.


The article state sync is only triggered every 5 minutes and on every full sync. So if you mark a few items as read on your phone1, sync and then open the app on phone2 (and sync) the articles show up with the correct state.

There was a bug that has been fixed in the server side app: https://github.com/nextcloud/news-android/issues/1105

Maybe also worth reading through the solution mentioned here by Tobias: https://github.com/nextcloud/news-android/issues/1117


smilingj commented 10 months ago

Ok, this seems to be typical: as soon as you take a closer look at a problem, it can no longer be traced (completely).

I wanted to systematically recreate the error and therefore proceeded as follows:

  1. initiate a refresh on the mobile phone.
  2. initiate a refresh on the tablet.
  3. make sure that both devices show the same latest few entries.
  4. read two entries on the mobile phone (they are marked as read).
  5. trigger a refresh on the mobile phone.
  6. initiate a refresh on the tablet.

The two read entries disappear on the tablet as expected, but the total number of unread articles is different on the two devices. The mobile phone shows 488 unread entries, while the tablet shows 3371 entries. See the attached screenshots. In my opinion, this should not be the case. After clearing the cache on the tablet, it also shows the same 488 entries as the mobile phone.

For the sake of completeness, here are the requested versions:

Server

Tablet (Samsung A8)

Mobile phone (Samsung A71)


I am aware that the news app on the server has not been released for the Nextcloud version used. However, as I do not use the web interface and synchronisation with the Android apps works (apart from the problem described above), as does the refresh of the sources, I assume that this does not play a role here. Also because I have been able to observe the described behaviour for some time (several versions).


The tickets mentioned, especially #1105, do indeed seem to be interesting and may describe the same or at least a similar problem. If this is the case (unfortunately I cannot judge this), this request could be closed as a duplicate

I will make sure that I keep an eye on these as well.


Screenshot Phone Screenshot Tablet

David-Development commented 9 months ago

@smilingj Thank you for the detailed writeup. Interesting that the total number of unread articles was different. Maybe related to this issue from 2014 - but it's a little different since the ticket is only regarding the initial sync. After the initial sync we only do incremental syncs. In case the sync is interrupted there could be some hickups (in theory it shouldn't matter but I believe this probably happened in your case). Glad to hear that clearing the cache worked for you. Hopefully it solved the issue for good now? Please keep me posted if it diverges again.

smilingj commented 9 months ago

Glad to hear that clearing the cache worked for you. Hopefully it solved the issue for good now?

Deleting the cache solves the problem once. Unfortunately, it occurs again and again, so I virtually always have to clear the cache as soon as I switch from one device to another.

A good solution for me would be an option in the settings that allows me to set the cache to always be cleared on refresh. This would probably result in higher data consumption, but would have the advantage that the status is always up to date.

David-Development commented 9 months ago

What's your server setup like? Are you using a 32bit or 64bit server?

smilingj commented 9 months ago

It's an Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-94-generic x86_64). The webserver is an Apache/2.4.52. PHP is version 8.1.2. And the database is MySql 8.0.36.

Can I help with any other data?