I have deleted some documents through a batch delete from a trigger in Cloud Functions. The console shows them as being deleted, however, my app still retrieves the docs! Th
Documents remain fetchable for a while after deletion. Their existence status rely on the DocumentSnapshot property - 'exists' and can be read and filtered in the pipe with snapshotChanges() method for docs and collections. See the example below:
...
.snapshotChanges()
.pipe(
map((actions: DocumentChangeAction[]) => {
return actions
.filter((a: DocumentChangeAction) => a.payload.doc.exists)
.map((a: DocumentChangeAction) => {
const data: T = {...a.payload.doc.data() as {}} as T;
data['id'] = a.payload.doc.id;
return data;
});
})
);