A user published a post almost a year ago. They trashed the post several months ago. In the app the post is shown in the "trashed" section (it says "trashed, local"), however when they try to recover it, it says "Unknown post".
The post has been probably permanently deleted, but it's still displayed in the app.
The post is not displayed in the app.
Unknown
App version 9.0.1
iPhone 7 (iOS 11.2.2)
More info hs 253646.
Another ticket 1485330-zen came about this.
This also came up in 1630250-zen. Both the posts that the user was seeing within the app had been permanently deleted (as they were trashed more than 30 days ago), but were showing up in the app. Attempting to restore them within the app caused an error.
Another report of this issue in 1693653-zen (screenshots in that ticket). The user's post was trashed more than 30 days ago but is still showing up within the app. It's not possible to restore the post from within the app.
@oguzkocer do you have any ideas here?
I believe this issue is related to the purge logic here. There are several predicates there that could prevent a post from being purged if the post itself is not in a valid state. (matching the remote state)
I have been able to reproduce it in one scenario, but I think there could be more like this. Here are the steps I followed:
Local changes similar to Android, maybe there isn't one like it on IOS, but I was able to attempt to upload the changes which ended up leaving the post in retry state)It'd be good to fix the above scenario, but as I mentioned, it might not be enough. My short term suggestion would be to handle the restore network call error. If the error is for the post being permanently deleted, we'll show the user an error and delete the local copy.
My long term suggestion would be to stop doing the purge in each refresh and keeping the post list data and the local post data separate, similar to how we recently started to do in Android.
@diegoreymendez @elibud Let me know if I can be further help!
An attempted fix has been proposed here but unfortunately it would bring other issues. The PR has an insightful discussion with details.
Bottom line, from @aerych 's point of view is:
Honestly, I think the best thing we could do is implement in iOS the post syncing/pagination logic that @oguzkocer has implemented in the Android app. It would fix this issue and many other edge cases we currently have.
If we have a good mechanism in Android, I definitely agree with him on it.
@aerych - Let's continue the conversation here... do you think this is an atomic bugfix task or would it be more appropriate as a planned mini-project?
do you think this is an atomic bugfix task or would it be more appropriate as a planned mini-project?
I think so, @kwonye this would fit great in your focus area, and @oguzkocer can advice the team implementing it in iOS.
do you think this is an atomic bugfix task or would it be more appropriate as a planned mini-project?
What Eli said :)
I think so, @kwonye this would fit great in your focus area, and @oguzkocer can advice the team implementing it in iOS.
I'd be happy to! I have been itching to document everything I have done on that project, but have been waiting to tackle post filters to use it as showcase. I think that'll prove very useful if we were to tackle this project in iOS. /cc @kwonye
There's another example of this in 1848275-zen (screenshot in ticket). The user's post was trashed in September, 2018, but showing up as a "local" post in the trash folder. It's not possible to restore the post.
Moving to high priority because with 5 referenced user reports it's one of the highest number for currently open bugs in WordPress-iOS
It just occurred to me how similar this is to https://github.com/wordpress-mobile/WordPress-iOS/issues/9567#issuecomment-461915050 lingering in the app and returning even after deleting and reinstalling the app. Is it possible all the affected users are self-hosted + Jetpack, or are these most likely orphaned local posts?
After testing extensively, I'm closing this issue, since even if I can get to the state where we have a post with local edits in the trash that doesn't exist remotely, I was able to permanently delete the local copy.