Replace when conflicts are encountered while applying remote diff
This commit is contained in:
parent
5d0060031a
commit
ee8d1e653c
2 changed files with 3 additions and 2 deletions
|
@ -365,6 +365,7 @@ class FilesDB {
|
|||
_getRowForFile(file),
|
||||
where: '$columnGeneratedID = ?',
|
||||
whereArgs: [file.generatedID],
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -223,10 +223,10 @@ class SyncService {
|
|||
await _db.insert(file);
|
||||
} else {
|
||||
// File exists on device
|
||||
bool wasUploadedOnAPreviousInstallation =
|
||||
existingFiles.length == 1 && existingFiles[0].collectionID == null;
|
||||
file.localID = existingFiles[0]
|
||||
.localID; // File should ideally have the same localID
|
||||
bool wasUploadedOnAPreviousInstallation =
|
||||
existingFiles.length == 1 && existingFiles[0].collectionID == null;
|
||||
if (wasUploadedOnAPreviousInstallation) {
|
||||
file.generatedID = existingFiles[0].generatedID;
|
||||
await _db.update(file);
|
||||
|
|
Loading…
Add table
Reference in a new issue