Skip to content

Sync comments content only if needed#17234

Merged
ealeksandrov merged 1 commit into
developfrom
issue/17202-fix-pagination-reset-in-comments
Sep 29, 2021
Merged

Sync comments content only if needed#17234
ealeksandrov merged 1 commit into
developfrom
issue/17202-fix-pagination-reset-in-comments

Conversation

@ealeksandrov

Copy link
Copy Markdown
Contributor

Fixes #17202.

Description

On each viewWillAppear method syncContent is called to reload all data, even if there is something already loaded.

The fix is adding a check and call syncContent only when it's needed (no loaded content).

To test:

  1. Run the app on an any device/simulator.
  2. Select a site that has many comments, such that it has two or more pages when scrolling down the comments list.
  3. Tap My Site > Comments.
  4. Scroll down until the fetch request for more content is triggered.
  5. Select any comment on page two.
  6. Tap Back.
  7. Check that the Comments list is still at same page and scroll position doesn't jump.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile

Copy link
Copy Markdown

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile

Copy link
Copy Markdown

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@dvdchr dvdchr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

Tested:

  • Scrolled to page two or more on the comments list, and tapped on one Comment. When going back to the list, the paging should be preserved.

Additional test scenarios:

  • Comments list content snippet should reflect the updated comment data.
  • Comments list should correctly remove any comment that's marked as spam or trash from the list.

@ealeksandrov ealeksandrov merged commit 3d44fed into develop Sep 29, 2021
@ealeksandrov ealeksandrov deleted the issue/17202-fix-pagination-reset-in-comments branch September 29, 2021 14:29
@ealeksandrov

Copy link
Copy Markdown
Contributor Author

Thanks for revew David!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments: Paging resets after returning from the comment detail screen

2 participants