wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.99k stars 1.33k forks source link

Posts viewed in the app reader persist even when deleted #10508

Open dllh opened 5 years ago

dllh commented 5 years ago

Expected behavior

When a post appears in the reader but is subsequently deleted, it should also be deleted from the reader view.

Actual behavior

When a post is viewed in the mobile app reader but is then deleted from the source blog, it remains visible in the reader.

Steps to reproduce the behavior

  1. Publish a post.
  2. View the site's feed in the mobile app reader and find the post.
  3. Delete the post. I deleted from within the app, but I don't think it matters.
  4. Refresh the feed in the mobile app reader. The post remains.

When I tested this, I checked that the deleted post that persists in the reader is deleted from the web reader's stream, even if it has been viewed in that stream previously. So I do not believe that this is an issue with the server-side feed being cached.

A user reported the issue, and I cannot reproduce for their site. The post they're still seeing is from April 9. They reported the issue initially on August 30 and sent screen shots showing a deleted post still displayed in the reader. When I load their site in my reader, I do not see that post. So I wonder if it has to do specifically with caching in the app of posts already viewed. The user confirms that the issue appears only in the app reader.

I also unfollowed and followed the site a couple of times from both within the reader and within the web app, and this didn't cause the posts to be removed from the reader view. But, when I re-follow and view the site feed itself within the app (from the "Followed Sites" tab), the deleted posts do not appear. But, further (I just kept trying things), if I add a post, view it from the single-site feed under the "Followed Sites" tab, delete it, and then try to refresh that view, the newly added and deleted post also persists.

It seems like the main feed view and the "Followed Sites" single-site feed view can get out of sync and that the mobile app is caching data that no longer lives in the feed itself.

2311337-z and follow-up #2362592-z

Tested on Pixel 3, Android 9, WPAndroid 13.2
dllh commented 5 years ago

Er, I tried to add labels, but either I lack permission or I'm being a dummy about how to add labels in GitHub.

carladoria commented 5 years ago

I don't see a way to add labels in this issue as well, it seems we don't have enough permissions on this repository

rachelmcr commented 5 years ago

Thanks for the report! I added the relevant labels. You'll need to be a member of the wordpress-mobile organization to add labels and such — we add labels while triaging new issues so it's no problem, but let us know if you'd like to be added.

planarvoid commented 5 years ago

I've looked into this and I think it's caused by pretty aggressive caching at the API endpoint. I'm comparing it to Calypso reader and I think it behaves the same way. I don't think there is anything we can do about this from the app POW. What do you think @rachelmcr ? I think the way forward would be to add a forced flag to the API so we can force loading of fresh data.

rachelmcr commented 5 years ago

Thanks for looking, @planarvoid! I'm a little confused, though, as the original report mentions testing this in the web Reader:

When I tested this, I checked that the deleted post that persists in the reader is deleted from the web reader's stream, even if it has been viewed in that stream previously. So I do not believe that this is an issue with the server-side feed being cached.

I also tested a couple scenarios with a WordPress.com Simple site:

  1. I viewed an existing post in the Followed Sites feed in the WPAndroid Reader and the Calypso web Reader.
  2. I deleted that post.
  3. In the Calypso web Reader, I refreshed the page and confirmed the post was gone. I also opened the site feed and confirmed the post was gone.
  4. In the WPAndroid Reader, I pulled to refresh and the post remained there. I opened the site feed and confirmed the post was gone from there.
  5. I completely closed and reopened the WPAndroid Reader and pulled to refresh again, and the post remained there.
  6. I deleted another post.
  7. In the Calypso web Reader, I refreshed the site feed page and confirmed the post was gone.
  8. In the WPAndroid Reader, I pulled to refresh the site feed and the post remained there.

There is some different behavior for external site feeds (not hosted at WordPress.com, see internal refs 8059-wpcom and p5PDj3-4xT-p2#comment-6657), but for simple sites like the one in this report I'm seeing the deleted post disappear from the Reader entirely on the web. The post disappears from the WPAndroid Reader if I haven't viewed the feed before (e.g. the site feed in step 3) but it remains in the feed if I've viewed that feed in the app.

rachelmcr commented 5 years ago

This also seems related to the behavior described in https://github.com/wordpress-mobile/WordPress-Android/issues/7834.

designsimply commented 5 years ago

Tested and confirmed using WPAndroid 13.4-rc-1 on Pixel 3 Android 10. (5m52s, 40s)

KristinaKay commented 5 years ago

Adding a comment so that I can respond to user when there is an update #2362592-z

planarvoid commented 5 years ago

@rachelmcr thanks for the detailed testing steps. The issue should be fixed in #10603 (fix for #7834). I've tried to compare the results in the web and the app reader and they behave the same way. I still see a delay because of the web cache but the behaviour is the same in Calypso (the post is visible in both readers for some time after it was deleted). After the post disappears from Calypso, it will disappear on PTR in the app as well.

ParaskP7 commented 3 years ago

👋 @designsimply and @planarvoid !

After consulting with @thehenrybyrd , I am reopening this issue as it seems that it still persists, at least on some occasions, just like the one described in the latest CfT (comment: p5T066-2hM#comment-8363-p2). You will also find a 2' mins video within that thread that makes it more clear.

PS: In addition to Android, on the web, refreshing the site's feed page will NOT remove the post, it will still be persisted there as well. So, it is seems to be a cross-platform issue.