Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remote files are not synced #1314

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/data/file_manager/file_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ class FileManager {
} else {
assert(filePath.startsWith('/'),
'Expected filePath to start with a slash, got $filePath');
return File(documentsDirectory + filePath);
if (filePath.startsWith(documentsDirectory)) {
// already contains document directory path
return File(filePath);
}
else {
return File(documentsDirectory + filePath);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/data/nextcloud/saber_syncer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class SaberSyncInterface
final bestFile = await getBestFile(syncFile);
switch (bestFile) {
case BestFile.local:
case BestFile.either:
// Local file is newer, do nothing
break;
case BestFile.remote:
case BestFile.either: //local file does not exists
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this part? BestFile.either should be when the local and remote files are equivalent, so no sync needs to occur for this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BestFile.either is also returned when local file does not exist. I did not searched the code why.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've improved this aspect in 01b28d9

changedFiles.add(syncFile);
}
}
Expand Down
Loading