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; };