fix the time mapping

This commit is contained in:
fyears 2024-04-05 00:23:05 +08:00
parent 0e6182b887
commit ca5ca5f576

View File

@ -221,14 +221,19 @@ const fullfillMTimeOfRemoteEntityInplace = (
remote: Entity, remote: Entity,
mtimeCli?: number mtimeCli?: number
) => { ) => {
// TODO:
// on 20240405, we find that dropbox's mtimeCli is not updated
// if the content is not updated even the time is updated...
// so we do not check remote.mtimeCli for now..
if ( if (
mtimeCli !== undefined && mtimeCli !== undefined &&
mtimeCli > 0 && mtimeCli > 0 /* &&
(remote.mtimeCli === undefined || (remote.mtimeCli === undefined ||
remote.mtimeCli <= 0 || remote.mtimeCli <= 0 ||
(remote.mtimeSvr !== undefined && (remote.mtimeSvr !== undefined &&
remote.mtimeSvr > 0 && remote.mtimeSvr > 0 &&
remote.mtimeCli >= remote.mtimeSvr)) remote.mtimeCli >= remote.mtimeSvr))
*/
) { ) {
remote.mtimeCli = mtimeCli; remote.mtimeCli = mtimeCli;
} }
@ -1171,8 +1176,13 @@ const dispatchOperationToActualV3 = async (
cipher, cipher,
r.local!.keyEnc r.local!.keyEnc
); );
// console.debug(`after uploadToRemote`);
// console.debug(`entity=${JSON.stringify(entity,null,2)}`)
// console.debug(`mtimeCli=${mtimeCli}`)
await decryptRemoteEntityInplace(entity, cipher); await decryptRemoteEntityInplace(entity, cipher);
// console.debug(`after dec, entity=${JSON.stringify(entity,null,2)}`)
await fullfillMTimeOfRemoteEntityInplace(entity, mtimeCli); await fullfillMTimeOfRemoteEntityInplace(entity, mtimeCli);
// console.debug(`after fullfill, entity=${JSON.stringify(entity,null,2)}`)
await upsertPrevSyncRecordByVaultAndProfile( await upsertPrevSyncRecordByVaultAndProfile(
db, db,
vaultRandomID, vaultRandomID,