diff --git a/addons/dexie-cloud/src/sync/encodeIdsForServer.ts b/addons/dexie-cloud/src/sync/encodeIdsForServer.ts index 0a828c19a..71d0fdcc8 100644 --- a/addons/dexie-cloud/src/sync/encodeIdsForServer.ts +++ b/addons/dexie-cloud/src/sync/encodeIdsForServer.ts @@ -34,13 +34,19 @@ export function encodeIdsForServer( const mutClone = changeClone.muts[mutIndex]; const rewrittenKey = JSON.stringify(key); mutClone.keys[keyIndex] = rewrittenKey; - if (rewriteValues) { + /* Bug (#1777) + We should not rewrite values. It will fail because the key is array and the value is string. + Only the keys should be rewritten and it's already done on the server. + We should take another round of revieweing how key transformations are being done between + client and server and let the server do the key transformations entirely instead now that + we have the primary key schema on the server making it possible to do so. + if (rewriteValues) { Dexie.setByKeyPath( (mutClone as DBInsertOperation).values[keyIndex], primaryKey.keyPath!, rewrittenKey ); - } + }*/ } else if (key[0] === '#') { // Private ID - translate! if (changeClone === change)