Skip to content

Node pagination results in duplicated and absent nodes #11266

@prestonraab

Description

@prestonraab

Steps

  1. Create a folder
  2. Put a large number of items in the folder (I reproduced this using 99 items, but it could show up as low 20)
  3. Request a node list of the folder through the api, for example:
  1. View each page

Expected

All files in the folder are on a page.

Actual

The last file on the first page is repeated on the second and third pages, and displaces the files that should be there.

This happens to:

The output_data/analysis_ready_metadata folder in the compedium I'm working with:

The THINGS-data model folder:

And the testing folder I created (This one is convenient because it's clear that test_11.txt and test_21.txt are replaced by test_1.txt on the second and third pages.)

Potential causes

My guess is that the bug involves sorting the nodes, perhaps in pagination.py. I notice that ordering within JSONAPIPagination is only enforced when the resource is embedded, while in SearchPagination ordering is always enforced. Perhaps moving the ordering to outside the if statement in JSONAPIPagination paginate_queryset would fix the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions