Skip to content

Commit

Permalink
Fixing #1777
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Aug 5, 2023
1 parent 29b4930 commit 60abec6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions addons/dexie-cloud/src/sync/encodeIdsForServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 60abec6

Please sign in to comment.