Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Apply ordering to querysets in paginated endpoints #411

Closed
seanpreston opened this issue Apr 25, 2022 · 0 comments · Fixed by #412
Closed

Apply ordering to querysets in paginated endpoints #411

seanpreston opened this issue Apr 25, 2022 · 0 comments · Fixed by #412
Assignees
Labels
bug Something isn't working

Comments

@seanpreston
Copy link
Contributor

Bug Description

Some of our paginated endpoints don't use a consistent ordering on the query sets they paginate. This means that the ordering can change between queries, and as such can lead to pagination where the same record is repeated on multiple pages. As per the Postgres spec (https://www.postgresql.org/docs/current/queries-order.html) if no sorting is explicitly chosen, rows will be returned in an unspecified order.

Affected Endpoints

  1. /connection
  2. /dataset
  3. /policy
  4. /storage/config

Expected Behaviour

  • Objects should be returned ordered by their .created_at field in descending order. ie. most recent objects first.
@seanpreston seanpreston added the bug Something isn't working label Apr 25, 2022
@seanpreston seanpreston self-assigned this Apr 25, 2022
TheAndrewJackson pushed a commit that referenced this issue Apr 26, 2022
* ensure all paginated queries have orders

* tests that ordering is correctly applied
adamsachs pushed a commit to adamsachs/fidesops_forked_test that referenced this issue May 17, 2022
* ensure all paginated queries have orders

* tests that ordering is correctly applied
sanders41 pushed a commit that referenced this issue Sep 22, 2022
* ensure all paginated queries have orders

* tests that ordering is correctly applied
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant