firebase / firebase/firebase-admin-node

Realtime Database never completes in terminal

未关闭
#2,210 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
api: database
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

### [REQUIRED] Step 2: Describe your environment

* Operating System version: macOS 13.2.1
* Firebase SDK version: 11.9.0
* Firebase Product: database (realtime database)
* Node.js version: v18.16.0
* NPM version: 9.5.1

### [REQUIRED] Step 3: Describe the problem

#### Steps to reproduce:

1. Setup Firebase project
2. Write code that makes a call to Realtime database
3. Execute this code with the terminal

#### Relevant Code:

```js
var admin = require("firebase-admin");

const projectId = process.env.GCLOUD_PROJECT;

var serviceAccount = require(process.env.GOOGLE_APPLICATION_CREDENTIALS);

admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: `https://${projectId}-default-rtdb.europe-west1.firebasedatabase.app/`,
});

var db = admin.database();
var ref = db.ref("/public_resource/");
ref.set("Hello World");

console.log("Updated.");
```

Repository with code to reproduce: https://github.com/nilsreichardt/playground/tree/realtime-database-terminal

https://github.com/firebase/firebase-admin-node/assets/24459435/93edea3e-00b2-49de-b59f-19c4057b737d

You can see in the video, that I executed the code, the write to realtime database executed but the terminal never completes. Only when abort the command with CONTROL + C, I can stop the command.

贡献指南

打开贡献指南

调研方向

先从链接的 playground 复现及其终端执行路径开始,然后检查 Realtime Database 客户端在 ref.set 完成后如何保持连接。使用指定的 Node.js 和 Firebase SDK 版本运行复现;当写入成功且终端无需 Control-C 即可退出时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, nodejs
领域
databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。