You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a query snapshot listener. When the callback is triggered for the first time, change.newIndex is always -1.
Relevant Code:
db.collection("cities").docChanges().forEach(change=>{if(change.oldIndex===-1){// Should only be true for added documents.// change.newIndex also equals -1, which should not be the case imo. Should be >= 0.}if(change.newIndex===-1){// Should only be true for removed documents.// Currently also true for added documents.}});
The text was updated successfully, but these errors were encountered:
@MieleVL Thanks for filing this. We have been changing the internals of our SDK and it looks like this might be a regression. We will try to get this fixed as soon as possible.
[REQUIRED] Describe the problem
DocumentChange.newIndex === -1 for 'added' events. According to the documentation, this should only be the case for 'removed' events: https://firebase.google.com/docs/reference/js/firebase.firestore.DocumentChange#newindex
Steps to reproduce:
Create a query snapshot listener. When the callback is triggered for the first time, change.newIndex is always -1.
Relevant Code:
The text was updated successfully, but these errors were encountered: