fix comparation of equality

This commit is contained in:
fyears 2024-04-03 00:03:58 +08:00
parent ee224bf4f2
commit 3d213b2be8

View File

@ -1096,14 +1096,17 @@ const dispatchOperationToActualV3 = async (
) { ) {
// !! we need to upsert the record, // !! we need to upsert the record,
// so that next time we can determine the change delta // so that next time we can determine the change delta
const entity = r.remote ?? r.local; // if we have prevSync, we store it because it should keep all necessary info
console.debug( let entity = r.prevSync;
`we are in actual operation of equal, entity=${JSON.stringify( // 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, entity,
null, r.local?.mtimeCli
2 );
)}` }
);
if (entity !== undefined) { if (entity !== undefined) {
await upsertPrevSyncRecordByVaultAndProfile( await upsertPrevSyncRecordByVaultAndProfile(
db, db,