firebase / firebase/firebase-admin-node
Realtime Database - indefinite hold after calling get()
- Langage dominant
- TypeScript
- Étoiles
- 1.7k
- Forks
- 419
- Merge moyen
- 3 j 10 h
- PR mergées (30 j)
- 16
Description
### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez le script Admin Node.js fourni à l’aide de admin.initializeApp(), database().ref().get() et goOffline(), puis inspectez le chemin Realtime Database utilisé par l’Admin SDK. C’est terminé lorsque le processus se termine après la lecture et le log final sans nécessiter de contournement supplémentaire ; le payload ne nomme aucun fichier ni test du dépôt.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- node.js, typescript
- Domaine
- databases
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100