-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Warn about importance of ordering for all pagination classes #8494
base: master
Are you sure you want to change the base?
Conversation
The ordering recommendations given for the CursorPagination scheme
actually apply to all pagination schemes, an unsuspecting developer that
implements the more common `LimitOffsetPagination` or
`PageNumberPagination` classes is unlikely to be aware of the importance
of consistent ordering.
This commit moves the `Details and limitations` section out of the
`CursorPagination` section and puts it as the very first subsection of
the `Pagination` page so that it's one of the first things that
developers see.
Some examples of inconsistencies as well as how to deal with them are
given, and an extra way to change the ordering of a paginated view is
provided.
Fixes #6886
I'm not convinced that this section makes sense when moved around like this. For example from a first look over - it discusses the |
You're right, when I wrote this patch I hadn't actually tried to implement I have made some changes, I kept it as a general section because the only Pagination class that is really different from the others is |
Segue sempre sem fazer nenhuma alteração |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@tomchristie any chance of ever getting something like this merged? I feel like it's an easy and dangerous trap to fall into |
did you addressed the concerns @tomchristie initially raised? |
@auvipy Well there was only one concern which was about the If there are any other concerns I'm willing to address them too |
|
||
If the main field that you wish to order by does not satisfy these conditions, you can order by multiple fields, as long as one of the fields fulfills all of the conditions above the result set should remain consistent across database calls. | ||
|
||
# inconsistent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to include for elaborate code example here including the pagination classes
The ordering recommendations given for the CursorPagination scheme
actually apply to all pagination schemes, an unsuspecting developer that
implements the more common
LimitOffsetPagination
orPageNumberPagination
classes is unlikely to be aware of the importanceof consistent ordering.
This commit moves the
Details and limitations
section out of theCursorPagination
section and puts it as the very first subsection ofthe
Pagination
page so that it's one of the first things thatdevelopers see.
Some examples of inconsistencies as well as how to deal with them are
given, and an extra way to change the ordering of a paginated view is
provided.
Fixes #6886
Hopefully this will prevent future developers from scratching their head and wondering why despite a view returning a count of X, going through all the pages yields Y records.