Skip to content

onChildAdded events not working in Database v9.8.4 SDK #6416

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

Closed
marcgallego opened this issue Jul 7, 2022 · 7 comments
Closed

onChildAdded events not working in Database v9.8.4 SDK #6416

marcgallego opened this issue Jul 7, 2022 · 7 comments

Comments

@marcgallego
Copy link

Describe your environment

  • Operating System version: macOS 12.4
  • Browser version: Chrome 103
  • Firebase SDK version: 9.8.4
  • Firebase Product: database

Describe the problem

After upgrading to version 9.8.4, onChildAdded events do not fire.

Steps to reproduce:

Update to version 9.8.4, without changing the source code.

Relevant Code:

  id.then((id) => {
    ref = ref(db, `path/${id}/other_path}`)
    onChildAdded(query(ref, limitToLast(1)), (snapshot) => {
      [...]
    }
@jbalidiong
Copy link
Contributor

Hi @rorencio, thanks for reaching out. I tried replicating, but I wasn't able to reproduce the same behavior.

If I can replicate the issue, I can have a better look into it. Please share a minimal, but complete sample of a project that I can run locally.

@google-oss-bot
Copy link
Contributor

Hey @rorencio. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@marcgallego
Copy link
Author

Hi again, I am having issues to replicate the issue with a minimal sample project. As soon as I reduce it to a minimal project, everything works fine. Unfortunately, I can not share the full version of my project either.
I have checked if it could have to do with the build tools I use, but the issue persists using CDNs. It also persists when using v9.9.0.

@jbalidiong
Copy link
Contributor

Thanks for the update, I've run a simple code and it is working fine on my end. I'm uncertain as to the cause of this inconsistent behavior. Let's leave the issue open for now, in case some of our engineers have an idea what caused this. Feel free to add more details. Thanks!

@hsubox76
Copy link
Contributor

This seems to be the only PR added in the 9.8.4 release, I'm not sure if anything in that would cause this effect. #6273

@maneesht
Copy link
Contributor

@rorencio - do you know if you were using get() in combination with onChildAdded? There was a bug where if a listener was called on a child path of a pending get then the listener's events wouldn't fire.
Or, if you know the last working version of this?

@marcgallego
Copy link
Author

Yes, that was totally my case as well! I've tried with the lastest version and it seems to work fine now! Thank you very much!

@firebase firebase locked and limited conversation to collaborators Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants