firestore: getPartitions() emits gax AutopaginateTrueWarning in every process
Maintainers usually reply within 1 day
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
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/google-cloud-node
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
googleapis/google-cloud-node#9854 ·
Maintainers usually reply within 1 day
-
pubsub: "Operation attempted on ended Span" when a modack is flushed after the message was ackedOpenapi: pubsub
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
googleapis/google-cloud-node#9853 ·
Maintainers usually reply within 1 day
-
storage: V4 getSignedUrl sorts canonical headers with localeCompare, so they disagree with X-Goog-SignedHeadersPossibly taken @itsrayeedscodespace claimed this 6 days ago. Openapi: storage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
googleapis/google-cloud-node#9840 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
googleapis/google-cloud-node#9723 ·
Maintainers usually reply within 1 day
-
spanner: requiring @google-cloud/spanner stops the process from exiting on SIGTERM/SIGINTMay be free again @alkatrivedi claimed this 31 days ago, and no pull request is open. Openapi: spanner
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
googleapis/google-cloud-node#9513 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
All issues in googleapis/google-cloud-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pieterjanscheir/belgica#201 ·
Maintainers usually reply within 1 day
-
accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
numerique-gouv/lasuite-landingpage#311 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
oxc-project/tsgolint#1362 ·
Maintainers usually reply within 1 day
-
bug external xai
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
langchain-ai/langchain#41854 ·
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
nemchik/biome-plugin-suitescript#137 ·
Maintainers usually reply within 1 day