firestore: getPartitions() emits gax AutopaginateTrueWarning in every process

Open Beginner friendly
#9,736 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@TheRealDanii is already working on this.

Since Nov 4, 2026.

  • #9816 by @TheRealDanii — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript
Domain
backend

Research direction

Start in handwritten/firestore/dev/src/index.ts and trace Firestore.requestStream() to createCallOptions(), checking how the options reach gax's stream paging call. Set autoPaginate to false on the stream call options, then verify getPartitions() completes without the warning and still reads partitions across pages.

Written by the indexing model from the issue text.

Description

api: firestore

Library: @google-cloud/firestore 7.11.3 (through firebase-admin 13.10.0), google-gax 4.6.1, Node.js 24. The same code is on main in handwritten/firestore/dev/src/index.ts.

Reproduction
// npm i @google-cloud/[email protected]
// FIRESTORE_EMULATOR_HOST=127.0.0.1:9 node repro.cjs
const {Firestore} = require('@google-cloud/firestore');
process.on('warning', w => console.log('warning event:', w.name));
const db = new Firestore({projectId: 'demo-repro'});
(async () => {
  for await (const _ of db.collectionGroup('any').getPartitions(2)) {}
})().catch(() => {});

No server is necessary: the warning is emitted when the request is built. Output:

(node:1) AutopaginateTrueWarning: Autopaginate will always be set to false in stream paging methods. See more info at https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#auto-pagination for more information on how to configure paging calls
warning event: AutopaginateTrueWarning
Cause

Firestore.requestStream() uses the call options from createCallOptions(), which do not set autoPaginate. gax's CallSettings sets autoPaginate to true when the option is not given. PageDescriptor.createStream() then warns for partitionQueryStream, a stream paging method, and forces autoPaginate: false. The caller cannot change this, because getPartitions() accepts no call options.

Expected

No warning. The partitions are read correctly; only the warning is wrong.

Why it matters

Node writes the warning to stderr. Cloud Run and Cloud Functions record stderr at severity ERROR, so each process that calls getPartitions() creates an Error Reporting event. googleapis/nodejs-firestore#2335 reported the same class of problem for listDocuments().

Suggested fix

Set autoPaginate: false on the call options in requestStream(). gax already uses that value for every stream paging method, and streams without paging ignore it. We apply this one-line change as a local patch. With the patch, a fake server that returns PartitionQuery results in two pages gives the same partitions and no warning.

Dominant language
TypeScript
Stars
3.2k
Forks
732
Avg merge
3d 7h
Merged PRs (30d)
117

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-node

All issues in googleapis/google-cloud-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.