Skip to content

Conversation

@calvinturbo
Copy link
Contributor

This PR contains:

  • added test to Firestore Replication test file, tests if replication correctly notices docs moving outside of replication scope

Describe the problem you have without this PR

Missing test for issue with Firestore docs moving outside of replication scope #7371

@pubkey
Copy link
Owner

pubkey commented Oct 9, 2025

I understand the problem.
But I see no way to fix this on the RxDB side atm. If there is no more permission to the doc, the sync will not know about the move-out-of-scope change to that document.
Atm docs are expected to either stay inside or outside of the scope, not change that.

@calvinturbo
Copy link
Contributor Author

I understand the problem. But I see no way to fix this on the RxDB side atm. If there is no more permission to the doc, the sync will not know about the move-out-of-scope change to that document. Atm docs are expected to either stay inside or outside of the scope, not change that.

This should be fixable, because Firestore sends a 'removed event', RxDB just needs to process that.

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
@calvinturbo
Copy link
Contributor Author

I'll check if I can make the necessary modifications to the Firestore Replication plugin, but I don't know if I am sufficiently qualified, will keep you posted

@pubkey pubkey force-pushed the test-firestore-outside-replication-scope branch from 9fbfa2b to 95a2621 Compare October 16, 2025 13:46
@pubkey
Copy link
Owner

pubkey commented Oct 22, 2025

Hi @calvinturbo
This PR fails on the CI, please check.

@calvinturbo
Copy link
Contributor Author

@pubkey I'll start working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants