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

Fixes bug that generates queries with cursor conditions out of order #73

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

jbernardo95
Copy link
Contributor

@jbernardo95 jbernardo95 commented Aug 18, 2020

In #68 we changed the cursor
data structure from a list to a map. Because elements in a map don't
have order among them, this change introduced a bug that causes
paginator to generate pagination queries with the cursor conditions
following the order in which they are stored in a map (which is random).

This PR fixes this by enforcing the cursor_fields order on the
cursor values when generating the pagination queries.

In #68 we changed the cursor
data structure from a list to a map. Because elements in a map don't
have order among them, this change introduced a bug that causes
paginator to generate pagination queries with the cursor conditions
following the order in which they are stored in a map (which is random).

This commit fixes this by enforcing the cursor_fields order on the
cursor values when generating the pagination queries.
Copy link
Contributor

@sgerrand sgerrand left a comment

Choose a reason for hiding this comment

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

Great fix for this problem.

LGTM. 👍

@sgerrand sgerrand mentioned this pull request Aug 18, 2020
1 task
@sgerrand sgerrand merged commit 0ab262a into master Aug 18, 2020
@sgerrand sgerrand deleted the sorts-order-bug branch August 18, 2020 16:47
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.

2 participants