firebase / firebase/firebase-admin-node
Realtime Database - indefinite hold after calling get()
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 16
Mô tả
### Operating System
Node JS 16
### Browser Version
Admin SDK
### Firebase SDK Version
11.7.0 (and also 12.2.0)
### Firebase SDK Product:
Database
### Describe your project's tooling
Admin Node JS SDK
### Describe the problem
Hi guys,
I built a simple script in Typescript that reads from the Database and prints the result. Whenever I do that, the newly created process does not close.
I'm not sure if this is an intended behaviour
I also added the `admin.database().goOffline();` as mentioned in https://github.com/firebase/firebase-js-sdk/issues/6932#issuecomment-1385331994 but didn't work.
### Steps and code to reproduce issue
Run the following js code
```javascript
admin.initializeApp();
_test();
async function _test() {
const ref = await admin
.database()
.ref('YOUR_REFERENCE')
.get();
const start_data = ref.val();
console.log(start_data);
admin.database().goOffline();
console.log('end');
}
```
You'll see that even though the console prints 'end', the program doesn't actually stop.
If you simply run
```javascript
admin.initializeApp();
_test();
async function _test() {
console.log('end');
}
```
the program stops as intended
Hướng dẫn đóng góp
Hướng nghiên cứu
Tái tạo script Admin Node.js được cung cấp bằng cách sử dụng admin.initializeApp(), database().ref().get() và goOffline(), sau đó kiểm tra đường dẫn Realtime Database được Admin SDK sử dụng. Được xem là hoàn tất khi tiến trình thoát sau thao tác đọc và log cuối cùng mà không cần thêm workaround; payload không nêu tên tệp hoặc bài kiểm thử nào trong repository.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- node.js, typescript
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100