angular / angular/angularfire

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

未關閉
#2,740 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
7.8k
分支
2.2k
平均合併
22 小時 28 分鐘
30 天內合併 PR
6

描述

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

貢獻指南

開啟貢獻指南

研究方向

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.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, firebase, typescript
領域
database
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。