Skip to content

Conversation

kafaichoi
Copy link

@kafaichoi kafaichoi commented Feb 3, 2025

Most of the changes are new test cases. There is no CI setup but u can test existing and new test all pass by mix test in local

@kafaichoi kafaichoi changed the title Kafai/add only has more to pagination option add only has more to pagination option Feb 3, 2025
options: options
}) do
entries_with_maybe_one_extra =
entries(query, repo, page_number, page_size, options, extra_entry_size: 1)
Copy link
Author

Choose a reason for hiding this comment

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

Here is the core logic where we fetch one more row than it should be.

If the total fetched entries are > page_size, we set has_more to true(and discard the last one from entries). Other, has_more is false

@kafaichoi kafaichoi force-pushed the kafai/add-only-has-more-to-pagination-option branch from 8c3c4a7 to b401a60 Compare February 3, 2025 08:42
@kafaichoi kafaichoi force-pushed the kafai/add-only-has-more-to-pagination-option branch from b401a60 to 86ebcef Compare February 3, 2025 11:31
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