firestore: getPartitions() emits gax AutopaginateTrueWarning in every process

Aberta Para iniciantes
#9,736 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@TheRealDanii já está trabalhando nisso.

Desde 4/11/2026.

  • #9816 de @TheRealDanii — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript
Domínio
backend

Direção de pesquisa

Comece em handwritten/firestore/dev/src/index.ts e acompanhe Firestore.requestStream() até createCallOptions(), verificando como as opções chegam à chamada de paginação do stream do gax. Defina autoPaginate como false nas opções de chamada do stream. Em seguida, verifique se getPartitions() é concluído sem o aviso e continua lendo partições em várias páginas.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
3.2k
Forks
732
Merge médio
3d 7h
PRs com merge (30d)
117

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de googleapis/google-cloud-node

Todas as issues de googleapis/google-cloud-node

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.