Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only three recent posts are kept on device #21754

Open
crazytonyli opened this issue Oct 13, 2023 · 4 comments
Open

Only three recent posts are kept on device #21754

crazytonyli opened this issue Oct 13, 2023 · 4 comments

Comments

@crazytonyli
Copy link
Contributor

The current behaviour—where the app deletes older posts and only keep three on the device—seems a bit strange to me.

Expected behavior

Loaded posts should not be deleted after switching to the Home screen.

Actual behavior

Older posts are deleted after switching to the Home screen.

Steps to reproduce the behavior

  1. Navigate to Posts screen and create 6 or more draft posts.
  2. Go to the root of My Sites tab (or the Home screen on iPad).
  3. Scroll through the home screen, or pull to refresh. Wait for a couple of seconds.
  4. Go back to the Posts screen. At this point, you should only see 3 drafts displayed on screen, but quickly after all drafts are re-fetched and displayed.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2023-10-13.at.14.35.31.mp4
Tested on [device], iOS [version], Jetpack iOS / WordPress iOS [version]

The trunk branch. 32404ca

@crazytonyli
Copy link
Contributor Author

There are two issues here.

Issue 1

PostsCardViewModel (and PagesCardViewModel) performs sync upon refreshing corresponding card cell. You can check out this behaviour by adding a log to the syncing post code and simply scrolling through the My Sites tab.

IMO, I don't think we should perform a post sync when the user just scrolls the screen.

Issue 2

In the sync posts (and pages) call, the purgesLocalSync option is set to true, which causes older posts being deleted from the device.


@hassaanelgarem I have assigned this issue to you, because you had made some sync related changes to PostsCardViewModel. Please feel free to un-assign yourself or assign the issue to someone else if you know who might be able to help.

@hassaanelgarem
Copy link
Contributor

Thanks for the ping @crazytonyli!
I haven't had time to check this. I plan to carve out some time next week to look at this.

@crazytonyli
Copy link
Contributor Author

The issue 2 mentioned in #21754 (comment) has been fixed by #21997

@crazytonyli
Copy link
Contributor Author

@hassaanelgarem The issue 1 mentioned in #21754 (comment) is still there. I'll leave it up to you to decided if it warrants a fix. I can close this issue and open a new one that's dedicated to the "issue 1", if you think that'll help making things clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants