Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

collectionChanges is firing for every element on a single deletion

オープン
#75 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@davideast がすでに取り組んでいます。

2023年8月1日 から。

  • #99 @blackholegalaxy による — オープン

評価

この issue はまだ評価されていません。

説明

I have AngularFire/RxFire code similar to the following:

collectionChanges(
    collection(this.firestore, "col1/doc1/col2"))
.subscribe(changes => {
  console.log('RxFire changes', changes);
});

This generally works: When the page loads, I get added events for every document in the collection. When a document changes, a single modified event fires. However, when a document is deleted, the next change batch includes a removed event (good) and also a modified event for every other element in the collection (bad). 🤔

Any idea why these extra modify events are happening + how to avoid all the extra reads? or is this all from the cache?

I've verified there's no actual change to the other documents in the collection. A single modified change mentions oldIndex and newIndex so I wonder if it's maybe trying to update the index of every element, but there isn't a sort order so any index is undefined anyways.


If it's helpful, as a test I tried the equivalent Firebase code:

const q = query(collection(this.firestore, "collection1/doc1/collection2"));

onSnapshot(q, (snapshot) => {
  const docs = snapshot.docChanges();
  console.log("Changes received", docs);
});

This works as expected and only fires one removed event, which is why I think the bug is in RxFire.

主要言語
TypeScript
スター
150
フォーク
50
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FirebaseExtended/rxfire のほかの issue

FirebaseExtended/rxfire の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。