Skip to content

startAfter doesn't work when given a document ref while an orderBy is also present #7434

@ashtonmoomoo

Description

@ashtonmoomoo

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

Image

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://github.com/ashtonmoomoo/firestore-bug

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. Clone the repo linked in this issue
  2. Install dependencies with npm i
  3. Update the configuration at the top of repro.ts
  4. Run npm run repro

A clear and concise description of what the bug is, and what you expected to happen.

I expect supplying a document reference to startAfter while a orderBy is present to work in the same way as it does when supplying a document snapshot to startAfter in the same scenario.

Using the reproduction script in the supplied repo, I expect the size of each resulting query snapshot to be 1. The last example query in the script has a size of 0.

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

As illustrated by the example queries in the script, using startAfter should behave the same whether it is given a snapshot or a ref, regardless of what other query clauses are present.

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the Firestore API.library: nodejs-firestoreIssues transferred from another repository

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions