From 6ed04a651b1d4713c81a6ecfb0906758d9384f9c Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 13 Jul 2024 23:11:54 +0800 Subject: [PATCH] simplify merge file --- pro/src/conflictLogic.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/pro/src/conflictLogic.ts b/pro/src/conflictLogic.ts index 28b2fb2..fc85ce2 100644 --- a/pro/src/conflictLogic.ts +++ b/pro/src/conflictLogic.ts @@ -1,4 +1,3 @@ -import cloneDeep from "lodash/cloneDeep"; import isEqual from "lodash/isEqual"; // import { // makePatches, @@ -145,20 +144,7 @@ export async function mergeFile( // left (local) must wait for the right // because the mtime might be different after upload // upload firstly - // hack: - // writing to remote with encryption will move the arraybuffer to worker - // so the newArrayBuffer is not usable later - // we have to copy here - // because mergable files should not be too large - // so the performance should not be too bad - // TODO: optimize for non-encryption mode? - const newArrayBufferCopied = cloneDeep(newArrayBuffer); - const rightEntity = await right.writeFile( - key, - newArrayBufferCopied, - mtime, - mtime - ); + const rightEntity = await right.writeFile(key, newArrayBuffer, mtime, mtime); // write local secondly const leftEntity = await left.writeFile( key,