Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realtime Database - indefinite hold after calling get() #2638

Open
tgpsantos opened this issue Jul 20, 2024 · 1 comment
Open

Realtime Database - indefinite hold after calling get() #2638

tgpsantos opened this issue Jul 20, 2024 · 1 comment

Comments

@tgpsantos
Copy link

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 firebase/firebase-js-sdk#6932 (comment) but didn't work.

Steps and code to reproduce issue

Run the following js code

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

admin.initializeApp();
_test();
async function _test() {
  console.log('end');
}

the program stops as intended

@DellaBitta
Copy link

Hi @tgpsantos,

This GitHub repo is for the Firebase Web Client SDK. The Admin SDK is hosted at https://github.com/firebase/firebase-admin-node.

I'll work to move this issue into that repository. Thanks!

@DellaBitta DellaBitta transferred this issue from firebase/firebase-js-sdk Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants