Fix files not unlocking after lock time expired#4962
Merged
Conversation
87966f7 to
c24e271
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4962 +/- ##
==========================================
+ Coverage 57.12% 57.23% +0.11%
==========================================
Files 138 138
Lines 17228 17359 +131
==========================================
+ Hits 9842 9936 +94
- Misses 7386 7423 +37
|
cd6f3ab to
792dab6
Compare
mgallien
reviewed
Sep 21, 2022
mgallien
left a comment
Collaborator
There was a problem hiding this comment.
would be nice to have a specific automated test to cover explicitly the scenario of the linked github issue
Collaborator
Author
Added local file lock state checking to the existing test for file locking |
cbac230 to
95f0dce
Compare
f9c162b to
5758444
Compare
allexzander
reviewed
Sep 26, 2022
allexzander
reviewed
Sep 26, 2022
5758444 to
a04d0fa
Compare
allexzander
reviewed
Sep 26, 2022
a04d0fa to
d2101a0
Compare
d2101a0 to
2e4b5c3
Compare
2e4b5c3 to
11a0949
Compare
allexzander
reviewed
Oct 3, 2022
allexzander
approved these changes
Oct 4, 2022
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
…runs Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
…ound the sync run is no longer needed Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
8af7c0b to
2f57133
Compare
|
SonarCloud Quality Gate failed. |
|
AppImage file: nextcloud-PR-4962-2f571337f18e559152521accb65d858905907b75-x86_64.AppImage |
Collaborator
Author
|
/backport to stable-3.6 |
1 task
8 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.








We have a bug where files are not unlocked after the lock timer expires. This is because there is no indication to the sync engine that a local lock state different to the server lock state needs to be acted on; on top of that, the call to update a file's metadata does not update the lock state of a file.
This PR fixes both of these issues by setting the instruction of an item with a local lock state different to the server to
CSYNC_INSTRUCTION_UPDATE_METADATA, and also ensures that lock state is updated in the database in the call toupdateLocalMetadata. It also starts a remote check when the file lock expires.EDIT: This PR now also schedules sync runs for files that need one to check lock status after the lock times out. Sync runs are minimised by grouping files into buckets of files that need sync runs within 60 seconds of each other, with sync occurring at the latest time possible (i.e. the file in that bucket with the latest sync run request time). Scheduled sync runs are also unscheduled if the file becomes unlocked by the user.
Closes #4956
Signed-off-by: Claudio Cambra claudio.cambra@gmail.com