angular / angular/angularfire

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

Open
#3,564 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
22h 28m
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with the linked firebase-observable-double-emission reproduction project and its package scripts; run it and press the update button to observe the docData stream. Compare the repeated identical emissions with the expected single emission, using the provided Stack Overflow discussion and logging note for context.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, firebase, typescript
Domain
database, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.