Repository navigation
lib/model: Return empty summary on paused folders (ref #6272) - #6326
Merged
Merged
Conversation
golangcibot
reviewed
Feb 11, 2020
AudriusButkevicius
previously approved these changes
Feb 11, 2020
calmh
reviewed
Feb 12, 2020
| errors, err := c.model.FolderErrors(folder) | ||
| if err == nil { | ||
| var snap *db.Snapshot | ||
| if snap, err = c.model.DBSnapshot(folder); err == nil { |
Member
There was a problem hiding this comment.
Also, DBSnapshot still returns errFolderMissing for non-started folders does it not?
No, I guess that's if it's actually missing from the config, which is fine. 👍
Member
There was a problem hiding this comment.
The snap is released (end of the if block) if its acquired.
Member
There was a problem hiding this comment.
Now it is, yes, but it wasn't when I commented. :)
Member
|
Needs merge |
imsodin
force-pushed
the
model/emptySummary
branch
from
February 12, 2020 10:22
b84cfba to
ea96eea
Compare
calmh
approved these changes
Feb 12, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This now actually addresses the 404 on the rest api that makes trouble for SyncTrayzor (https://forum.syncthing.net/t/rest-db-status-returns-404-on-startup/14329). The behaviour is, that we return an empty folder summary in that case. I think that's not a good API and instead the folder summary service should have access to the db for paused folders as well (e.g. global and local state are still useful info then), but that's a much bigger change. This just makes sure the behaviour doesn't change.
I didn't add a rest api error, as it can't use the model package. However I added a test in the model that makes sure that no error is returned when getting a folder summary for a paused folder.