pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.58k stars 1.06k forks source link

replicate firestore not replicating correctly #6064

Closed marnec closed 4 months ago

marnec commented 5 months ago

I can't create a working pull request because this bug requires a firestore database;

I have a minimal Angular test PWA that instantiates a single collection called inbox with Dexiejs

after awaiting creation and migration, I start the firestore replication:


this.rxDatabase = await createRxDatabase<...>(...);
const collections = await this.rxDatabase.addCollections({...});
if (collections.inbox.migrationNeeded()) await collections.inbox.startMigration(10);

const replicationState = replicateFirestore({
    collection: collections.inbox,
    replicationIdentifier: 'inbox',
    autoStart: true,
    live: true,
    pull: {},
    push: {},
    firestore: {
        database: this.firestore,
        collection: collection(this.firestore, 'inbox'),
        projectId: environment.firebase.appId
    },
})

documents in firebase have the serverTimestamp correctly filled, and the serverTimestamp property is not added to RxJsonSchema of the document as per documentation

the replication shows the following behaviours:

firestore_subs_loop

I looked online, read the discord and tried many different configuration but I can't get it working

pubkey commented 5 months ago

Shouldnt it be possible to make a PR with a test that shows the failing emulator behavior?

marnec commented 5 months ago

Shouldnt it be possible to make a PR with a test that shows the failing emulator behavior?

Yes I'll try as soon as possible, thanks for the quick reply

stale[bot] commented 5 months ago

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.

stale[bot] commented 4 months ago

Issues are autoclosed after some time. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem.