The PouchDB changes observers in Sync could cancel each other while
events would still be emitted but those emitted for
waitForNewChanges would not get returned to the caller because
this.changes would be null at that point.
We would then stop synchronizing changes!
Separating the changes observers using local variables should fix this.
Please make sure the following boxes are checked:
[ ] PR is not too big
[ ] it improves UX & DX in some way
[ ] it includes unit tests matching the implementation changes
[ ] it includes scenarios matching a new behaviour or has been manually tested
The PouchDB changes observers in Sync could cancel each other while events would still be emitted but those emitted for
waitForNewChanges
would not get returned to the caller becausethis.changes
would be null at that point.We would then stop synchronizing changes!
Separating the changes observers using local variables should fix this.
Please make sure the following boxes are checked: