Skip to content

Passing DocumentReference to Firestore.pipeline().documents() throws "Error: INTERNAL ERROR: Client is not yet ready to issue requests." #9186

Description

@dvoloshyn

Please make sure you have searched for information in the following guides.

Library Name

@google-cloud/firestore 9.0.0

A screenshot that you have tested with "Try this API".

Issue is with the library, not with the API

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/dvoloshyn/9a2923e7e5e43182731ba5c33e6027a0

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

See the linked gist, it is obvious

A clear and concise description of what the bug is, and what you expected to happen.

When validating DocumentReference, the library accesses projectId without triggering lazy initialization which results in exception below. Passing string value works fine. I expect it to work for references as well

"Error: INTERNAL ERROR: Client is not yet ready to issue requests.
    at mT.get projectId (/node_modules/.pnpm/@google-cloud+firestore@9.0.0/node_modules/@google-cloud/firestore/build/src/index.js:686:19)
    at mT.get formattedName (/node_modules/.pnpm/@google-cloud+firestore@9.0.0/node_modules/@google-cloud/firestore/build/src/index.js:711:33)
    at W$._validateReference (/node_modules/.pnpm/@google-cloud+firestore@9.0.0/node_modules/@google-cloud/firestore/build/src/pipelines/pipelines.js:91:45)
    at dr (/node_modules/.pnpm/@google-cloud+firestore@9.0.0/node_modules/@google-cloud/firestore/build/src/pipelines/pipelines.js:75:33)
    at Array.forEach (<anonymous>)
    at W$.documents (/node_modules/.pnpm/@google-cloud+firestore@9.0.0/node_modules/@google-cloud/firestore/build/src/pipelines/pipelines.js:75:14)
    at _deleteSubscriptions (/src/dual-asset.ts:53:10)
    at deleteSubscriptions (/src/dual-asset.ts:39:28)
    at <anonymous> (/src/bot.ts:85:41)
    at <anonymous> (/node_modules/.pnpm/grammy@1.45.1/node_modules/grammy/out/web.mjs:1626:71)"

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

Documentation does not mention that passing DocumentReference will throw
/**
* Specifies the source as a set of documents.
*
* @PARAM docs The document references.
* @returns A new Pipeline object with the documents as the source.
*/
documents(docs: Array<string | DocumentReference>): Pipeline;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions