From d65571a245988e5d7df6c799e98a3759ce26d652 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 16 Jun 2019 22:49:18 +0200 Subject: [PATCH] Handle special case: Both sides deleted --- sync/logic.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sync/logic.go b/sync/logic.go index b2673a3..3f83c0c 100644 --- a/sync/logic.go +++ b/sync/logic.go @@ -26,7 +26,16 @@ func (s *Sync) decideAction(syncState *state, fileName string) error { case change.HasAll(ChangeLocalDelete, ChangeRemoteDelete): // Special case: Both vanished, we just need to clean up the sync cache logger.Debug("File deleted locally as well as remotely") - // TODO: Handle special case + + if err := s.deleteDBFileInfo(sideLocal, fileName); err != nil { + logger.WithError(err).Error("Unable to delete local file info") + return nil + } + + if err := s.deleteDBFileInfo(sideRemote, fileName); err != nil { + logger.WithError(err).Error("Unable to delete remote file info") + return nil + } case change.Is(ChangeLocalAdd) || change.Is(ChangeLocalUpdate): logger.Debug("File added or changed locally, uploading...")