fix comparation of equality

This commit is contained in:
fyears 2024-04-03 00:03:58 +08:00
parent ee224bf4f2
commit 3d213b2be8
1 changed files with 10 additions and 7 deletions

View File

@ -1096,14 +1096,17 @@ const dispatchOperationToActualV3 = async (
) {
// !! we need to upsert the record,
// so that next time we can determine the change delta
const entity = r.remote ?? r.local;
console.debug(
`we are in actual operation of equal, entity=${JSON.stringify(
// if we have prevSync, we store it because it should keep all necessary info
let entity = r.prevSync;
// if we don't have prevSync, we use remote entity AND local mtime
// as if it is "uploaded"
if (entity === undefined && r.remote !== undefined) {
entity = await decryptRemoteEntityInplace(r.remote, cipher);
entity = await fullfillMTimeOfRemoteEntityInplace(
entity,
null,
2
)}`
);
r.local?.mtimeCli
);
}
if (entity !== undefined) {
await upsertPrevSyncRecordByVaultAndProfile(
db,