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’ll 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

Allow current user lock #3206

merged 1 commit into from
Oct 20, 2023

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 ↗︎

@juliusknorr juliusknorr self-requested a review October 9, 2023 10:49
@juliusknorr juliusknorr 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

@juliusknorr juliusknorr self-assigned this Oct 11, 2023
@juliusknorr
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

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

Pushed a few adjustments

@juliusknorr juliusknorr 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 ✔️

@juliusknorr juliusknorr 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>
@juliusknorr juliusknorr force-pushed the fix/noid/allow-current-user-lock branch from 19e0719 to 0a5afd4 Compare October 19, 2023 13:22
@juliusknorr
Copy link
Member

/backport to stable27

@juliusknorr
Copy link
Member

/backport to stable26

@juliusknorr
Copy link
Member

/backport to stable25

@juliusknorr juliusknorr merged commit 1509e55 into main Oct 20, 2023
52 checks passed
@juliusknorr juliusknorr 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.

2 participants