angular / angular/angularfire

Multiple valueChange subscriptions for same collection leads to one subscription firing changes for another

Offen
#2,740 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
7.8k
Forks
2.2k
Ø Merge
22 Std. 28 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### Version info

**Angular:** 10.0.9

**Firebase:** ^7.13.1

**AngularFire:** ^6.02

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

### How to reproduce these conditions

Create multiple valueChange subscriptions to the same collection (with a different query)
```
this.db.collection('/people/' + this.selectedPeopleId + '/messages', ref => ref.orderBy("createdDate").limitToLast(100)).valueChanges({idField: 'documentId'}).subscribe(messageUpdates =>
```
AND

```
this.db.collection('/people/' + this.selectedPeopleId + '/messages', ref => ref.where("type", ">", 0).limitToLast(100)).valueChanges({idField: 'documentId'}).subscribe(messageUpdates =>
```

In my case, I am unsubscribing from the second listener and recreating it with a different limitToLast value (though I'm unsure if that's necessary to reproduce)

### Debug output
none

### Expected behavior

Each valueChange listener should only fire results for itself

### Actual behavior

the first listener is returning valueChanges that match the query for the second listener.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start at the AngularFire collection().valueChanges() entry point and reproduce the two subscriptions against the same /people/.../messages collection with different queries. Verify that unsubscribing and recreating the second listener does not alter results delivered to the first; done means each subscription emits only its own query results.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, firebase, typescript
Bereich
database
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.