Skip to content

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Mar 23, 2022

  • Lock/unlock a file when opening/closing
  • Open files in read only mode when locked
  • Indicate other lock in the UI
  • Safeguard unlocking through the cleanup cronjob if no close request was sent
  • Changing ETag on lock/unlock causes a conflict, so we either need a way to still propagate the change to the root without changing the actual file tag for shares as mentioned in Collaborative locking files_lock#54 or adjust the change detection in text to maybe also compare the mtime in addition

To be tested together with nextcloud/files_lock#54

Signed-off-by: Julius Härtl <[email protected]>

TMP: Switch to OCP branch for tests

Signed-off-by: Julius Härtl <[email protected]>

Let locked files open in read only

Signed-off-by: Julius Härtl <[email protected]>

Adapt LockScope to LockContext rename

Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: Julius Härtl <[email protected]>
@juliusknorr juliusknorr marked this pull request as ready for review April 21, 2022 14:04
@juliusknorr
Copy link
Member Author

/compile amend /

Signed-off-by: Julius Härtl <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

LGTM. A few minor remarks.

$this->lockManager->lock(new LockContext(
$file,
ILock::TYPE_APP,
Application::APP_NAME
Copy link
Member

Choose a reason for hiding this comment

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

Out of topic but this could become Application::APP_ID at some point.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, something for a separate PR.

Application::APP_NAME
));
} catch (NoLockProviderException $e) {
} catch (PreConditionNotMetException $e) {
Copy link
Member

Choose a reason for hiding this comment

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

No warning logs here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd let the actual lock provider handle that, from the text app side there is no special interest if we unlock a file that has already been unlocked.

@juliusknorr juliusknorr merged commit d61932e into master Apr 21, 2022
@delete-merged-branch delete-merged-branch bot deleted the enh/locking branch April 21, 2022 16:08
@juliusknorr
Copy link
Member Author

/backport to stable24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review backported successfully backported enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants