firestore: getPartitions() emits gax AutopaginateTrueWarning in every process

Aperta Adatta ai principianti
#9,736 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@TheRealDanii ci sta già lavorando.

Dal 4/11/2026.

  • #9816 di @TheRealDanii — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
backend

Direzione di ricerca

Inizia da handwritten/firestore/dev/src/index.ts e segui Firestore.requestStream() fino a createCallOptions(), verificando come le opzioni arrivano alla chiamata di paginazione dello stream di gax. Imposta autoPaginate su false nelle opzioni di chiamata dello stream. Poi verifica che getPartitions() termini senza l’avviso e continui a leggere le partizioni su più pagine.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
3.2k
Fork
732
Merge medio
3g 7h
PR unite (30g)
117

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/google-cloud-node

Tutte le issue di googleapis/google-cloud-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.