-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi,
I am using RxDB with Firestore replication. I also have a premium license.
I am using replication for the Firestore collection 'shipments' with where filters.
where('status', 'in', [ShipmentStatusEnum.PENDING, ShipmentStatusEnum.RETRIEVED, ShipmentStatusEnum.DELIVERED, ShipmentStatusEnum.ONROUTE, ShipmentStatusEnum.PLANNEDFORROUTE])
Therefore, only shipments with above statutes get replicated.
In my application, you can modify the status of one or multiple shipments at the same time. If you change the status to a status not listed above via Firestore directly, the shipments statutes do not change in the application. If you modify the shipments via RxDB directly, they will change in the clients browser, but not on other clients.
Example: User A changes shipment 1 and 2 to status 'cancelled'. They change in their browser, but the status remains the same in User B's browser, because they don't process the event coming from Firestore.
https://firebase.google.com/docs/firestore/query-data/listen#view_changes_between_snapshots
shows an example how to correctly process these changes
If a document moves out of the replication scope because it no longer matches the filters, a 'removed' event is received by Firestore client.
I have verified this myself with my application.

RxDB should correctly process 'removed' events and .remove() documents that are no longer in the Firestore replication scope.