Reset locks

This commit is contained in:
Andras Schmelczer 2025-02-23 11:31:03 +00:00
parent 78266267c6
commit eeb7999d76
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
3 changed files with 12 additions and 2 deletions

View file

@ -47,4 +47,9 @@ export class DocumentLocks {
this.locked.delete(relativePath);
}
}
public reset(): void {
this.locked.clear();
this.waiters.clear();
}
}

View file

@ -157,6 +157,7 @@ export class Syncer {
this.remainingOperationsListeners.forEach((listener) => {
listener(0);
});
this.internalSyncer.reset();
}
private async syncRemotelyUpdatedFile(
@ -214,7 +215,7 @@ export class Syncer {
);
this.logger.debug(
`Document ${relativePath} was not found under its current path in the database but was found under a different path ${originalFile[0]}, scheduling sync to move it`
`Document '${originalFile[0]}' was not found under its current path in the database but was found under a different path (${relativePath}), scheduling sync to move it`
);
return this.internalSyncer.unrestrictedSyncLocallyUpdatedFile(
{

View file

@ -527,7 +527,11 @@ export class UnrestrictedSyncer {
}
}
public async tryIncrementVaultUpdateId(
public reset(): void {
this.locks.reset();
}
private async tryIncrementVaultUpdateId(
responseVaultUpdateId: number
): Promise<void> {
if (this.database.getLastSeenUpdateId() === responseVaultUpdateId - 1) {