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.
As defined in the spec for pagination, a client should be able to use the
cursorvalue obtained from thepaging_metadataof 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.