startAt, startAfter, endAt and endBefore on the query builder take ...values: unknown[], so any value compiles. Passing the previous page's document, startAfter(last), compiles and the driver sends the whole document as a map value, so the cursor matches nothing useful and the page repeats or comes back empty. A value of the wrong type, or the wrong number of values for the orderBy chain, compiles the same way. The SDK's own cursor form, startAfter(snapshot), is unreachable because reads return plain documents rather than snapshots, and it is the form that avoids the precision loss in #1. Cursor values should be typed against the preceding orderBy fields, and passing a document should be a compile error until a document can serve as a cursor. Cause: src/core/query.ts:112 types the four cursor methods as unknown[].
startAt,startAfter,endAtandendBeforeon the query builder take...values: unknown[], so any value compiles. Passing the previous page's document,startAfter(last), compiles and the driver sends the whole document as a map value, so the cursor matches nothing useful and the page repeats or comes back empty. A value of the wrong type, or the wrong number of values for theorderBychain, compiles the same way. The SDK's own cursor form,startAfter(snapshot), is unreachable because reads return plain documents rather than snapshots, and it is the form that avoids the precision loss in #1. Cursor values should be typed against the precedingorderByfields, and passing a document should be a compile error until a document can serve as a cursor. Cause:src/core/query.ts:112types the four cursor methods asunknown[].