deleteApp apparently doesn't complete teardown of Firestore connections
@lahirumaramba is already working on this.
Since Feb 24, 2025.
Assessment
This issue has not been assessed yet.
Description
Describe your environment
- Operating System version: Fedora Linx 38
- Firebase SDK version: 13.0.2
- Firebase Product: admin SDK apparently / Firestore
- Node.js version: 22.12.0
- NPM version: 11.0.0
- Deno version 2.1.4
Describe the problem
I'm running a simple Deno test of writing to a document in a Firestore collection. The test passes, but Deno detects leaks:
error: Leaks detected:
- "http2Client" was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
- "http2ClientConnection" was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
- 2 intervals were started in this test, but never completed. This is often caused by not calling `clearInterval`.
- 2 timers were started in this test, but never completed. This is often caused by not calling `clearTimeout`.
- An async call to op_http2_poll_client_connection was started in this test, but never completed.
Steps to reproduce:
deno test --allow-all leaks-bug.ts
leaks-bug.ts
import { initializeApp, cert, deleteApp } from 'firebase-admin/app';
import { getFirestore } from 'firebase-admin/firestore';
import { assertExists } from '@std/assert';
Deno.test('test',
async () => {
// Initialize Cloud Firestore per https://firebase.google.com/docs/firestore/quickstart#initialize -> Node.js -> Initialize on your own server
const app = initializeApp({ credential: cert('service-account-key.json') });
const db = getFirestore(app);
const doc = await db.collection('test').doc('test').set({ foo: 42 });
assertExists(doc); // passes
await deleteApp(app); // doesn't help
await new Promise(resolve => setTimeout(resolve, 10 * 1000)); // doesn't help
}
);
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 16
Contributor 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 firebase/firebase-admin-node
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 comments · 1 assignee ·
-
api: messaging
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Difficulty 5/5 Over a week Newbie friendliness 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comment · 1 assignee ·
All issues in firebase/firebase-admin-node
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100