Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

collectionChanges is firing for every element on a single deletion

Aperta
#75 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@davideast ci sta già lavorando.

Dal 1/8/2023.

  • #99 di @blackholegalaxy — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
TypeScript
Stelle
150
Fork
50
Merge medio
11g 6h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FirebaseExtended/rxfire

Tutte le issue di FirebaseExtended/rxfire

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.