Remove double-delete notifications

This commit is contained in:
Andras Schmelczer 2025-05-25 09:57:22 +01:00
parent f93ca447d8
commit a340039301
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -155,6 +155,18 @@ export class Syncer {
public async syncLocallyDeletedFile( public async syncLocallyDeletedFile(
relativePath: RelativePath relativePath: RelativePath
): Promise<void> { ): Promise<void> {
if (
this.database.getLatestDocumentByRelativePath(relativePath)
?.isDeleted === true
) {
// This is must be a consequence of us deleting a file because of a remote update
// which triggered a local delete, so we don't need to do anything here.
this.logger.debug(
`Document ${relativePath} has already been markes as deleted, skipping`
);
return;
}
// We have to have a record of the delete in case there's an in-flight update for the same // We have to have a record of the delete in case there's an in-flight update for the same
// document which finishes after the delete has succeeded and would introduce a phantom metadata record. // document which finishes after the delete has succeeded and would introduce a phantom metadata record.
this.database.delete(relativePath); this.database.delete(relativePath);