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

Draft list is not updated correctly when publishing a post from the Drafts tab #19550

Open
vanessamaartinstt opened this issue Nov 1, 2022 · 1 comment

Comments

@vanessamaartinstt
Copy link

vanessamaartinstt commented Nov 1, 2022

Expected behavior

Draft list should be updated correctly to reflect the number of posts that remains in the Drafts tab.

Actual behavior

When publishing a draft post from Drafts tab, the draft list shows only 3 drafts after publishing. It’s resolved by refreshing the list manually.

Steps to reproduce the behavior

  1. Go to My Site > Posts > Drafts (You need to have five or more draft posts available)
  2. Select one of the drafts and tap on ... More > Publish Now > Publish
  3. Notice that the list only shows 3 drafts
Tested on [device], iOS [version], WPiOS [version]

Device: Iphone 14 Pro Max
iOs Version: 16.1
WP/JP version: 21.1

RPReplay_Final1667339113.MP4
@alpavanoglu
Copy link
Contributor

I think I have trapped this issue in a small area but I wasn't able to resolve it. Most of the code here is 8 years old and WPTableViewHandler, the possible culprit, seems to be in use throughout the codebase.

What is happening here is this line is being called more than necessary. When a draft post is published, that line is called once which is reasonable. But then it gets called until the remaining number is 3. So if we had 9 draft posts and we publish one (now 8), that line gets called an additional 5 more times so the resulting number is 3.

Also number of items in the resultsController is 3 right when we open this screen rather than the correct number 9. Then it syncs with backend and updates.

@alpavanoglu alpavanoglu removed their assignment Dec 9, 2022
@salimbraksa salimbraksa self-assigned this Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Groundskeeping
  
To Do
Development

No branches or pull requests

3 participants