-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[firestore] Set the cursor to empty when the end is reached #7448
Conversation
// This solution here seems to be the the most common but I haven't been able to find | ||
// any documented hard guarantees on firestore not early returning for some reason like response |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a peek at the source code of firestore.DocumentItarator
. Looks like GetAll()
is just a convenience wrapper around Next()
, which collects all results until iterator.Done
reached. Since the docs guarantee that Next()
only returns iterator.Done
if there are actually no more documents matching the query, I think we can treat this as effectively guaranteed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bot.
* nil firestore cursor on end * added explainer
* nil firestore cursor on end * added explainer
The pagination contract now requires that the cursor is set to empty once the end of a query is reached. Previously we didn't run all tests in CI and it worked somewhat wierd so I had to resort to running tests manually and switching them around which was not very reliable nor good. Firestore CI recently got fixed and this enables the rest of the tests to now run correctly. This PR makes sure the cursor is set to empty correctly once the end of the events have been reached. New UI changes rely on this behaviour.