Firestore removed events do not get processed(?)
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.
Can you make a PR with a test case that reproduces your problem? You can start with this template.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.
Ping, pretty busy right now, but will write the test soon
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.
Created pull request, added test case to firestore-replication.test file https://github.com/pubkey/rxdb/pull/7445
This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.