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(firestore): correct cursor flipping in limit_to_last #28137

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

sarub0b0
Copy link
Contributor

  • Fix Google::Cloud::Firestore::Query#limit_to_last

Ensure that cursors are correctly flipped when using limit_to_last in Firestore queries. This change moves the assignment of new_start_at and new_end_at outside of the conditional blocks to ensure they are always set correctly. Added tests to cover scenarios with order, start_at, and end_at in combination with limit_to_last.

closes: #27527

* Fix Google::Cloud::Firestore::Query#limit_to_last

Ensure that cursors are correctly flipped when using limit_to_last in
Firestore queries. This change moves the assignment of new_start_at and
new_end_at outside of the conditional blocks to ensure they are always
set correctly. Added tests to cover scenarios with order, start_at, and
end_at in combination with limit_to_last.

closes: #27527
Copy link
Member

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

This looks great, thank you!

@dazuma dazuma merged commit 13b1dde into googleapis:main Jan 6, 2025
10 checks passed
@github-actions github-actions bot added the release-please:force-run To run release-please label Jan 6, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Jan 6, 2025
@sarub0b0 sarub0b0 deleted the fix-firestore-limit-to-last branch January 7, 2025 05:24
@github-actions github-actions bot added the release-please:force-run To run release-please label Jan 7, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Jan 7, 2025
@github-actions github-actions bot added the release-please:force-run To run release-please label Jan 8, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Jan 8, 2025
shubhangi-google pushed a commit to shubhangi-google/google-cloud-ruby that referenced this pull request Jan 16, 2025
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.

Firestore: unexpected results when combining start_at or end_at with limit_to_last in queries
2 participants