Skip to content

server/app/interfaces/base: _get_slice(...) returns wrong cursor value #520

@hpoeche

Description

@hpoeche

As defined in the spec for pagination, a client should be able to use the cursor value obtained from the paging_metadata of a previous response to query the next part from the result set.

In the implementation of _get_slice(...) the cursor value is used to carry a 1-based index to the next element of the result set, which has not been requested so far.
This value is converted to a 0-based index (subtracted by 1) to slice the result set. In the computation of the new cursor, the conversion from 1-based index to 0-based index is not reversed, which results in the new cursor value to be too low by 1.

Fix: Add 1 to the new cursor value, to convert back from 0-based to 1-based indexing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions