Skip to content

fix(firestore): preserve async limit_to_last ordering#17879

Open
Sanjays2402 wants to merge 1 commit into
googleapis:mainfrom
Sanjays2402:fix/firestore-async-limit-to-last
Open

fix(firestore): preserve async limit_to_last ordering#17879
Sanjays2402 wants to merge 1 commit into
googleapis:mainfrom
Sanjays2402:fix/firestore-async-limit-to-last

Conversation

@Sanjays2402

Copy link
Copy Markdown

Closes #17767

The async limit-to-last path compared a protobuf direction enum with a string, so ascending queries were never reversed before fetching. Compare the enum name, matching the synchronous query path, and cover both directions.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@Sanjays2402
Sanjays2402 requested a review from a team as a code owner July 23, 2026 10:14
@google-cla

google-cla Bot commented Jul 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an issue in async_query.py where order.direction was compared directly instead of using its .name attribute. It also updates the corresponding unit test test_asyncquery_get_limit_to_last to be parameterized, verifying the behavior for both ascending and descending directions. There are no review comments, so I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant