Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brettski opened this issue Apr 28, 2021 · 0 comments
Open

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

brettski opened this issue Apr 28, 2021 · 0 comments
Assignees
Labels
bug Something isn't working critical

Comments

@brettski
Copy link
Member

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 || '',
      });
@brettski brettski added bug Something isn't working critical labels Apr 28, 2021
@brettski brettski self-assigned this Apr 28, 2021
@brettski brettski added this to Backlog in THAT Backlog via automation Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical
Projects
THAT Backlog
  
Backlog
Development

No branches or pull requests

1 participant