Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

collectionChanges is firing for every element on a single deletion

Abierto
#75 3 comentarios 0 reacciones 1 asignado Ver en GitHub

@davideast ya está trabajando en esto.

Desde el 1/8/2023.

  • #99 de @blackholegalaxy — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
150
Forks
50
Merge medio
11 d 6 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de FirebaseExtended/rxfire

Todos los issues de FirebaseExtended/rxfire

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.