Skip to content

fix: Resolve pagination issue by fetching last content directly from the database#798

Open
PruthiviRaj27 wants to merge 1 commit intomasterfrom
fix_pagination_not_working
Open

fix: Resolve pagination issue by fetching last content directly from the database#798
PruthiviRaj27 wants to merge 1 commit intomasterfrom
fix_pagination_not_working

Conversation

@PruthiviRaj27
Copy link
Contributor

@PruthiviRaj27 PruthiviRaj27 commented Feb 14, 2025

Issue:

  • Pagination was not working correctly for running content due to the incorrect retrieval of the last item in the list.
  • Previously, PagingState was used to get the last item, which did not always return the correct content.
  • This caused LoadType.APPEND to fail since it couldn't determine the next page properly.

Fix:

  • Replaced PagingState lookup with a database query getLastContent to fetch the last content item based on contentOrder.
  • Updated the getRemoteKeyForLastItem method to use this database query instead of relying on state.pages.
  • Simplified getPageNumber logic by removing the unused state parameter.

@PruthiviRaj27 PruthiviRaj27 changed the title fix fix: Resolve pagination issue by fetching last content directly from the database Feb 14, 2025
@PruthiviRaj27 PruthiviRaj27 force-pushed the fix_pagination_not_working branch from 60060a4 to 10a426e Compare February 24, 2025 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant