fix many bugs

This commit is contained in:
fyears
2024-02-24 23:25:15 +08:00
parent c512330d84
commit 40020c3e44
5 changed files with 82 additions and 41 deletions
+4 -2
View File
@@ -412,7 +412,9 @@ export const getAllPrevSyncRecordsByVault = async (
db: InternalDBs,
vaultRandomID: string
) => {
// log.debug('inside getAllPrevSyncRecordsByVault')
const keys = await db.prevSyncRecordsTbl.keys();
// log.debug(`inside getAllPrevSyncRecordsByVault, keys=${keys}`)
const res: Entity[] = [];
for (const key of keys) {
if (key.startsWith(`${vaultRandomID}\t`)) {
@@ -431,7 +433,7 @@ export const upsertPrevSyncRecordByVault = async (
prevSync: Entity
) => {
await db.prevSyncRecordsTbl.setItem(
`${vaultRandomID}-${prevSync.key}`,
`${vaultRandomID}\t${prevSync.key}`,
prevSync
);
};
@@ -441,7 +443,7 @@ export const clearPrevSyncRecordByVault = async (
vaultRandomID: string,
key: string
) => {
await db.prevSyncRecordsTbl.removeItem(`${vaultRandomID}-${key}`);
await db.prevSyncRecordsTbl.removeItem(`${vaultRandomID}\t${key}`);
};
export const clearAllPrevSyncRecordByVault = async (