Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Continuation token does not work if first page contains all null in orderby field #114

Open
irriss opened this issue Sep 20, 2019 · 1 comment

Comments

@irriss
Copy link

irriss commented Sep 20, 2019

Let say I am excecuting this query

SELECT VALUE t.startDate FROM Items t ORDER BY t.startDate ASC

And it returns this result:
(please notice - there are 8 records with null)

[
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    "1994-06-30T00:00:00Z",
    "1998-03-31T00:00:00Z",
    "1998-12-31T00:00:00Z",
    "1999-03-31T00:00:00Z",
    "1999-07-11T00:00:00Z",
    "2000-01-31T00:00:00Z",
    "2003-03-07T00:00:00Z",
    "2004-06-22T00:00:00Z",
    "2005-09-30T00:00:00Z",
    "2005-10-19T00:00:00Z",
    "2006-02-28T00:00:00Z",
    "2006-08-01T00:00:00Z"
]

If I use
Cosmonaut.Extensions.PaginationExtensions.WithPagination<T>(this IQueryable<T> queryable, string continuationToken, int pageSize);
and pass pageSize such that first page will contain only null in the ORDER BY field, let say pageSize = 7, then requesting second page with continuation token will return me only 1 record and no more pages.

If I pass pageSize bigger than 8 it will return all records in following pages.

I am not sure whether it's a bug in Comsos Db, Cosmos Db SDK or Cosmonaut.

@Elfocrash
Copy link
Owner

Hello @irriss.

Can you please provide a code snippet of how you are trying to do that so I can debug locally?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants