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

docData observable stream emits identical object values multiple times in a row #3564

Open
folsze opened this issue Aug 30, 2024 · 1 comment

Comments

@folsze
Copy link

folsze commented Aug 30, 2024

Version info

Angular: ^18.0.0

Firebase: ^10.13.0

AngularFire: ^18.0.1

Other (e.g. Ionic/Cordova, Node, browser, operating system):

"@ionic/angular": "^8.0.0",

Tested on MacOS Chrome, but reproducible elsewhere. Else let me know.

How to reproduce these conditions

Simply press the update button after strating this project, it will update the game entity and make it emit twice:
https://github.com/folsze/firebase-observable-double-emission

here is a related stackoverflow post that I created:

https://stackoverflow.com/questions/78891192/firebase-docdata-stream-emits-identical-object-values-multiple-times-in-a-row

Steps to set up and reproduce

run with package json npm run

then simply press the update button, it will update the game entity and make it emit twice:

Debug output

image

** Output from firebase.database().enableLogging(true); **
<- I have no idea what this is suppoed to do for me. I added this but receive no logs:

import { enableLogging } from '@angular/fire/database';

enableLogging(true);

Expected behavior

It only emits once

Actual behavior

it emits multiple times (twice currently for this simple scenario):

image
@folsze
Copy link
Author

folsze commented Sep 12, 2024

This library function docData has many flaws. I inspected the browser network tab and noticed that there is multiple streams being created from a single docData call.

Also this does not seem to be able to start even a single stream with the cacitor-ios version:

https://stackoverflow.com/questions/78977750/angular-fire-docdata-works-on-chrome-safari-macos-but-never-emits-on-capacitor-i

I would suggest at least adding a hint into the library, that multiple streams could be created, that this is an open bug in the library. Because developers are using this function assuming it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant