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 files not unlocking after lock time expired #4962
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
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.
would be nice to have a specific automated test to cover explicitly the scenario of the linked github issue
Added local file lock state checking to the existing test for file locking |
cbac230
to
95f0dce
Compare
f9c162b
to
5758444
Compare
5758444
to
a04d0fa
Compare
a04d0fa
to
d2101a0
Compare
d2101a0
to
2e4b5c3
Compare
2e4b5c3
to
11a0949
Compare
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 |
/backport to stable-3.6 |
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