From 749ef4009f9dd5ff0748ec23991f7fa327f50ea8 Mon Sep 17 00:00:00 2001 From: Ldoppea Date: Fri, 13 Sep 2024 17:03:18 +0200 Subject: [PATCH] feat: Prevent local PouchDB modification to be replicated to remote DB For now we don't want to replicate local changes into remote PouchDB as we first want to ensure everything works as expected locally before activating two-way replication in the future --- src/pouchdb/getLinks.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pouchdb/getLinks.ts b/src/pouchdb/getLinks.ts index 5ad1d6abe..b4ffe5781 100644 --- a/src/pouchdb/getLinks.ts +++ b/src/pouchdb/getLinks.ts @@ -30,7 +30,17 @@ export const getLinks = (): CozyLink[] => { doctypes: offlineDoctypes, initialSync: true, platform: platformReactNative, - ignoreWarmup: true + ignoreWarmup: true, + doctypesReplicationOptions: Object.fromEntries( + offlineDoctypes.map(doctype => { + return [ + doctype, + { + strategy: 'fromRemote' + } + ] + }) + ) } const stackLink = new StackLink({