firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

getCountFromServer does not accept startAfter Query Constraint

Open bridges-wood opened this issue 9 months ago • 3 comments

Operating System

macOS 14.4.1 (23E224)

Browser Version

Arc Version 1.42.0 (49714)

Firebase SDK Version

10.11.1

Firebase SDK Product:

Firestore

Describe your project's tooling

Nest.js app with webpack

Describe the problem

When calling getCountFromServer with no orderBy constraints and a startAfter constraint accepting a snapshot the following error was raised:

3 INVALID_ARGUMENT: Cursor has too many values

Steps and code to reproduce issue

Call getCountFromServer with a query using a startAfter constraint.

bridges-wood avatar May 12 '24 22:05 bridges-wood

Hi @bridges-wood!

Congratulations, I think you might have found a bug. Looking through the SDK code, I have a theory as to why this might happen.

I still need to reproduce the bug, at which point we can prioritize fixing this. I'll update this issue as we make progress.

Thanks for reporting this!

tom-andersen avatar May 12 '24 23:05 tom-andersen

Here's a follow up for you @bridges-wood.

Cursor support in aggregations is a known limitation. To make this work will require some engineering work. I cannot make any promises on when this work will be prioritized, as we are also working on other query features.

tom-andersen avatar May 13 '24 15:05 tom-andersen

@tom-andersen Thanks for the update.

bridges-wood avatar May 13 '24 15:05 bridges-wood