Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow current user lock #3206

Merged
merged 1 commit into from Oct 20, 2023
Merged

Conversation

ArtificialOwl
Copy link
Member

No description provided.

@cypress
Copy link

cypress bot commented Sep 28, 2023

15 failed tests on run #669 鈫楋笌

15 7 5 5 Flakiness 0
鈿狅笍 You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Allow current user lock
Project: Richdocuments Commit: a26d592bce
Status: Failed Duration: 11:29 馃挕
Started: Oct 17, 2023 9:46 AM Ended: Oct 17, 2023 9:57 AM

Review all test suite changes for PR #3206 鈫楋笌

@juliushaertl juliushaertl self-requested a review October 9, 2023 10:49
@juliushaertl juliushaertl added bug Something isn't working 3. to review Ready to be reviewed labels Oct 9, 2023

// This is a quick custom patch to allow richdocuments to accept lock from current user
/** @var OCP\IUserSession $userSession */
$userSession = \OC::$server->get(\OCP\IUserSession::class);
Copy link
Member

Choose a reason for hiding this comment

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

We don't have a user session on those requests, we probably should just check against $wopi->getEditorUid(). However this would then still allow conflicts if the file gets locked by the desktop client and the same user opens it in Collabora.

@ArtificialOwl Can you provide some more backgorund which case this change should cover?

Copy link
Member Author

Choose a reason for hiding this comment

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

you can reproduce the issue:

  • userA lock a shared file,
  • userA open the freshly locked file with richdocument,
  • the app will not open the said document

@juliushaertl juliushaertl self-assigned this Oct 11, 2023
@juliushaertl
Copy link
Member

  • User lock is accepted for opening with the same user (edit permissions)
  • If a user lock is present we should open the file read only for other users

@juliushaertl juliushaertl force-pushed the fix/noid/allow-current-user-lock branch from 6652f3c to 479037c Compare October 17, 2023 08:58
@juliushaertl
Copy link
Member

Pushed a few adjustments

@juliushaertl juliushaertl force-pushed the fix/noid/allow-current-user-lock branch 3 times, most recently from a26d592 to 1df469a Compare October 17, 2023 10:27
@ArtificialOwl
Copy link
Member Author

Tested 鉁旓笍

@juliushaertl juliushaertl force-pushed the fix/noid/allow-current-user-lock branch from 1df469a to 19e0719 Compare October 19, 2023 12:43
Signed-off-by: Julius H盲rtl <jus@bitgrid.net>
@juliushaertl juliushaertl force-pushed the fix/noid/allow-current-user-lock branch from 19e0719 to 0a5afd4 Compare October 19, 2023 13:22
@juliushaertl
Copy link
Member

/backport to stable27

@juliushaertl
Copy link
Member

/backport to stable26

@juliushaertl
Copy link
Member

/backport to stable25

@juliushaertl juliushaertl merged commit 1509e55 into main Oct 20, 2023
52 checks passed
@juliushaertl juliushaertl deleted the fix/noid/allow-current-user-lock branch October 20, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Ready to be reviewed bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants