Skip to content

Paged view, descending order by Date not working correctly #91

Description

@brettski

When ordering by a date field, descending and using the data field for a startAfter value, the last value from the previous page is the first value of the new page. Date fields used for paging in ASCENDING order work as expected still.

Something changed either at Firestore or the Firestore SDK. The only workaround found at this time is to remove 1 ms from the time sent in the cursor. For example as done in order:

      const curCreatedAt = new Date(lastdoc.createdAt.getTime() - 1);
      const cpieces = JSON.stringify({
        curCreatedAt,
        curEventId: eventId || '',
      });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcritical

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions