Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

db.terminate appears to detect BulkWriter leak from recursiveDelete #2273

@dandv

Description

@dandv

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

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

image

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

https://github.com/dandv/firestore-recursiveDelete-vs-db.terminate-leaks

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

  1. Have Deno installed
  2. git clone https://github.com/dandv/firestore-recursiveDelete-vs-db.terminate-leaks.git
  3. cd firestore-recursiveDelete-vs-db.terminate-leaks
  4. Supply the service-account-key.json
  5. Run deno test -A recursive-delete.ts

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

The output shows the following error:

error: "All onSnapshot() listeners must be unsubscribed, and all BulkWriter instances must be closed before terminating the client. There are 0 active listeners and 1 open BulkWriter instances."

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. **

https://googleapis.dev/nodejs/firestore/latest/Firestore.html#recursiveDelete mentions "recursiveDelete() uses a BulkWriter instance with default settings to perform the deletes". It doesn't explictly document the bulkWriter parameter as optional, but it is optional, and apparently not closed after the deletion.

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the googleapis/nodejs-firestore API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions