mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 22:46:04 +03:00
case clash should not prevent full propagation
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
4b5186d2bb
commit
b68754827c
2 changed files with 24 additions and 2 deletions
|
@ -1333,6 +1333,7 @@ void PropagateRootDirectory::slotSubJobsFinished(SyncFileItem::Status status)
|
|||
if (status != SyncFileItem::Success
|
||||
&& status != SyncFileItem::Restoration
|
||||
&& status != SyncFileItem::BlacklistedError
|
||||
&& status != SyncFileItem::FileNameClash
|
||||
&& status != SyncFileItem::Conflict) {
|
||||
if (_state != Finished) {
|
||||
// Synchronously abort
|
||||
|
@ -1355,12 +1356,12 @@ void PropagateRootDirectory::slotSubJobsFinished(SyncFileItem::Status status)
|
|||
case SyncFileItem::FileLocked:
|
||||
case SyncFileItem::Restoration:
|
||||
case SyncFileItem::FileNameInvalid:
|
||||
case SyncFileItem::FileNameClash:
|
||||
case SyncFileItem::DetailError:
|
||||
case SyncFileItem::Success:
|
||||
break;
|
||||
case SyncFileItem::FileNameClash:
|
||||
case SyncFileItem::BlacklistedError:
|
||||
_errorStatus = SyncFileItem::BlacklistedError;
|
||||
_errorStatus = status;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1282,6 +1282,27 @@ private slots:
|
|||
QVERIFY(fileThirdSync);
|
||||
QCOMPARE(fileThirdSync->lastModified.toSecsSinceEpoch(), CURRENT_MTIME);
|
||||
}
|
||||
|
||||
void testFolderRemovalWithCaseClash()
|
||||
{
|
||||
FakeFolder fakeFolder{ FileInfo{} };
|
||||
fakeFolder.remoteModifier().mkdir("A");
|
||||
fakeFolder.remoteModifier().insert("A/file");
|
||||
|
||||
QVERIFY(fakeFolder.syncOnce());
|
||||
QCOMPARE(fakeFolder.currentLocalState(), fakeFolder.currentRemoteState());
|
||||
|
||||
fakeFolder.remoteModifier().insert("A/FILE");
|
||||
QVERIFY(!fakeFolder.syncOnce());
|
||||
|
||||
fakeFolder.remoteModifier().mkdir("B");
|
||||
fakeFolder.remoteModifier().rename("A/file", "B/file");
|
||||
fakeFolder.remoteModifier().remove("A");
|
||||
|
||||
QVERIFY(!fakeFolder.syncOnce());
|
||||
auto folderA = fakeFolder.currentLocalState().find("A");
|
||||
QCOMPARE(folderA, nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
QTEST_GUILESS_MAIN(TestSyncEngine)
|
||||
|
|
Loading…
Reference in a new issue