Skip to content

Conversation

patrickfreed
Copy link
Contributor

RUST-1046 (fixes #482)

This PR fixes a bug in SessionCursor where iterating it with next() would always eventually result in an error if the result count wasn't divisible by the batchSize.

where
T: DeserializeOwned + Unpin,
{
exhausted: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the issue here is that the GenericCursor created in stream was using the info.id field to determine if the cursor was exhausted rather than this exhausted field, which would cause it to iterate past the end and return an error. This was fixed by using info.id as the single source of truth as to whether the SessionCursor is exhausted or not.

@patrickfreed patrickfreed marked this pull request as ready for review October 8, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aggregate_with_session fails when collection size > batchSize

3 participants