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

fix: Use correct limit when retrying a limit query stream with a cursor #2203

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

ehsannas
Copy link
Contributor

When a query is streamed and the stream fails after receiving part of the result set, the client retries the stream with a cursor. If the original query has a limit, the retry logic should use a modified limit for the remainder of the stream to ensure the final result contains the correct number of documents.

fixes #2200

When a query is streamed and the stream fails after receiving part of the
result set, the client retries the stream with a cursor. If the original
query has a limit, the retry logic should use a modified limit for the
remainder of the stream to ensure the final result contains the correct
number of documents.
@ehsannas ehsannas requested review from a team as code owners September 27, 2024 22:51
@ehsannas ehsannas self-assigned this Sep 27, 2024
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: firestore Issues related to the googleapis/nodejs-firestore API. labels Sep 27, 2024
Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by comment: Are you able to add a test for this scenario? Maybe the test added in #1806 could be an example?

@ehsannas
Copy link
Contributor Author

yes, I am planning to add tests.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: s Pull request size is small. labels Oct 1, 2024
@ehsannas ehsannas requested a review from dconeybe October 1, 2024 22:17
@ehsannas ehsannas assigned dconeybe and unassigned ehsannas Oct 1, 2024
@ehsannas ehsannas requested a review from dconeybe October 2, 2024 19:13
Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@ehsannas ehsannas added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 2, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 2, 2024
@ehsannas ehsannas merged commit ab94092 into main Oct 2, 2024
18 checks passed
@ehsannas ehsannas deleted the ehsann/fix-2200 branch October 2, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/nodejs-firestore API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Too many documents returned from query.stream with limit after retry
3 participants