-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL Replication Plugin: Allow syncing revisions #2000
Conversation
@pubkey When I run the tests on my local using "npm run test:node" or "npm run test:fast", the tests seem to be passing. Any idea? |
Can you delete your local |
@pubkey Thanks! That worked. Have fixed the tests now. |
@gautambt sry for the late response. |
@pubkey Agree that it is better to not have plugin specific code in the core. I can change the _replication_id field to be user-configurable. However, in this case, the user will have to manually declare the field in the schema. Otherwise, when the user loads a document with this field set, the schema check will fail. Is this developer experience okay? Since the field is completely internal to the plugin I am wondering if it is possible to remove it when the document loads via some kind of a hook. |
@gautambt yes I would be okay with the dev experience when the user has do specify which field is used as revision. Depending on how much time you have, it might be better to add the first solution now and later migrate to using the hooks to handle everything internally. For the next version 9.X.X I am rewriting a lot of internal stuff so it should be easier to add the internal handling afterwards. |
@pubkey Have renamed _replication_id to last_pulled_rev, made it configurable and remvoed changes to the core. Please have a look. |
I merged this now. I also added it to the changelog. It would be cool if you could update the documentation. |
Thank you for your work on this @gautambt (and of course @pubkey for this great offline-first db!). |
I had written a blog post at that time that might be useful: https://hasura.io/blog/couchdb-style-conflict-resolution-rxdb-hasura |
Thx for the blog post ! If I understand correctly, there's no out of the box solution and one seems to need to replicate the desired conflict resolution manually client and serverside. |
This PR fixes #1830
I've added a new flag syncRevisions. When this flag is set: