firebase / firebase/firebase-admin-node

Realtime Database - indefinite hold after calling get()

Abierto
#2,638 1 comentario 0 reacciones 0 asignados Ver en GitHub
api: database
Lenguaje dominante
TypeScript
Estrellas
1.7k
Forks
419
Merge medio
3 d 10 h
PR fusionados (30 d)
16

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el script de Admin Node.js proporcionado usando admin.initializeApp(), database().ref().get() y goOffline(), y luego inspecciona la ruta de Realtime Database utilizada por el Admin SDK. Se considera terminado cuando el proceso sale después de la lectura y del registro final sin requerir una solución alternativa adicional; el payload no menciona archivos ni pruebas del repositorio.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
node.js, typescript
Área
databases
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.