From e82dfc1e882e354b7681f881a1014b0a27936cfc Mon Sep 17 00:00:00 2001 From: fyears Date: Sun, 21 Nov 2021 22:54:31 +0800 Subject: [PATCH] fix unknown decision --- src/sync.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sync.ts b/src/sync.ts index c119240..e38e502 100644 --- a/src/sync.ts +++ b/src/sync.ts @@ -161,8 +161,8 @@ const ensembleMixedStates = async ( r = { key: key, exist_remote: true, - mtime_remote: backwardMapping.localMtime, - size_remote: backwardMapping.localSize, + mtime_remote: backwardMapping.localMtime || entry.lastModified, + size_remote: backwardMapping.localSize || entry.size, remote_encrypted_key: remoteEncryptedKey, }; } else { @@ -388,6 +388,10 @@ const getOperation = ( r.decision_branch = 11; } + if (r.decision === "unknown") { + throw Error(`unknown decision for ${r}`); + } + return r; };