Skip to content

Commit 905e823

Browse files
committed
fix(SyncProcess#removeMapping): Only wait for GC to remove mappings with atomic adapters
Signed-off-by: Marcel Klehr <[email protected]>
1 parent 66b8927 commit 905e823

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/lib/Account.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export default class Account {
313313

314314
if (mappings) {
315315
// Remove superfluous items from mappings
316-
// as we don't remove items immediately anymore, due to possible interrupts
316+
// as we don't remove items immediately for anymore (for Atomic adapters), due to possible interrupts
317317
await mappings.gc(cache)
318318
// store mappings
319319
await mappings.persist()

src/lib/strategies/Default.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,15 @@ export default class SyncProcess {
13811381
} else {
13821382
localId = item.id
13831383
}
1384-
// We don't remove from mappings immediately anymore, but wait for GC
1384+
if (!this.server.isAtomic()) {
1385+
if (item.type === 'folder') {
1386+
await this.mappings.removeFolder({ localId, remoteId })
1387+
} else {
1388+
await this.mappings.removeBookmark({ localId, remoteId })
1389+
}
1390+
} else {
1391+
// We don't remove from mappings immediately anymore, but wait for GC
1392+
}
13851393
}
13861394

13871395
async loadChildren(

0 commit comments

Comments
 (0)