Skip to content

Firestore removed events do not get processed(?) #7371

@calvinturbo

Description

@calvinturbo

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.

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions