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
lib/model: Record error for unavailable files #5066
Conversation
Currently unavailable files show up as out-of-sync in the UI without any progress or explanation. Now these files will be added to the failed items. The changed count isn't inreased, as there is no point in retrying those files until a change in connection happens. At that point, a pull will be scheduled anyway.
lib/model/folder_sendrecv.go
Outdated
@@ -353,7 +354,7 @@ func (f *sendReceiveFolder) processNeeded(ignores *ignore.Matcher, dbUpdateChan | |||
return true | |||
} | |||
} | |||
l.Debugln(f, "Needed file is unavailable", file) | |||
f.newError("checking availability", file.Name, errNotAvailable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps just pull
rather than check availability.
lib/model/folder_sendrecv.go
Outdated
@@ -66,6 +66,7 @@ var ( | |||
errDirHasToBeScanned = errors.New("directory contains unexpected files, scheduling scan") | |||
errDirHasIgnored = errors.New("directory contains ignored files (see ignore documentation for (?d) prefix)") | |||
errDirNotEmpty = errors.New("directory is not empty") | |||
errNotAvailable = errors.New("no peers that have this file are connected. Will be retried on next connection.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very long, The crux here is that no connected device has this version of the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even "latest version of the file"
lib/model/folder_sendrecv.go
Outdated
@@ -354,7 +353,7 @@ func (f *sendReceiveFolder) processNeeded(ignores *ignore.Matcher, dbUpdateChan | |||
return true | |||
} | |||
} | |||
f.newError("checking availability", file.Name, errNotAvailable) | |||
f.newError("processing needed", file.Name, errNotAvailable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is visible in the UI, having processing needed
will just make the string very long, just download
or pull
lib/model/folder_sendrecv.go
Outdated
@@ -353,7 +353,7 @@ func (f *sendReceiveFolder) processNeeded(ignores *ignore.Matcher, dbUpdateChan | |||
return true | |||
} | |||
} | |||
f.newError("processing needed", file.Name, errNotAvailable) | |||
f.newError("pull", file.Name, errNotAvailable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also add file.ModifiedBy to the error message, explaining who has the file.
Purpose
Currently unavailable files show up as out-of-sync in the UI without any progress
or explanation. Now these files will be added to the failed items. The changed
count isn't inreased, as there is no point in retrying those files until a change
in connection happens. At that point, a pull will be scheduled anyway.
Testing
None.