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 force unlock of automated client locks #391

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Nov 14, 2024

This will make sure that lock owners can still unlock stale locks from clients that use the token type 2. We will show a confirmation dialog as revoking a lock could cause conflicts with file changes if the client comes back online assuming the lock would still be present.

Steps to test:

  • Connect the desktop client to a nextcloud server with this branch and files_lock app enabled
  • Sync an office document
  • Open the file on the desktop (e.g. with libreoffice)
  • The file shuld now be locked on the web UI
  • Kill the desktop client so the lock is stale
  • Try to unlock in the web

Replaces #172
Fix #325

  • Needs a proper UI component for the confirmation dialog

UI changes

  • Add hint if a client locked the file next to the user name (As the tooltip)
Screenshot 2024-11-15 at 10 39 31
  • Show confirmation modal when force unlocking another clients lock
Screenshot 2024-11-15 at 10 37 36

@juliusknorr juliusknorr added bug Something isn't working 3. to review labels Nov 15, 2024
@juliusknorr juliusknorr changed the title fix/unlock app lock Allow force unlock of automated client locks Nov 15, 2024
@juliusknorr juliusknorr marked this pull request as ready for review November 15, 2024 09:46
@juliusknorr
Copy link
Member Author

/backport to stable30

@juliusknorr
Copy link
Member Author

/backport to stable29

@juliusknorr
Copy link
Member Author

/backport to stable28

@juliusknorr
Copy link
Member Author

/backport to stable27

@juliusknorr
Copy link
Member Author

Will fix the conflict once I merged the remaining dependency updates on main

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Had a look at the code. Did not test it though.

@MaxXor
Copy link

MaxXor commented Dec 6, 2024

When can we see a release with this? 🙂

@DanScharon
Copy link

When can we see a release with this? 🙂

good question. The backports have been merged so a release including this feature would be nice. I hope with the next minor releases we can get it

@max-nextcloud
Copy link
Collaborator

I hope with the next minor releases we can get it

Yes... next minor releases will include this. I'd expect them to be released mid January sometime around the next server releases.

@Jerome-Herbinet
Copy link
Member

Interesting feature, but I really think you need to get it via the desktop sync client as well (local files).

@Jerome-Herbinet
Copy link
Member

@juliusknorr

Correct me if I'm wrong: the new forced unlock function is only available on the side of the user who opened (automatically locked) the document?

According to the tests I've carried out, this is the case, but I'd like you to confirm this.

If you confirm this, I think it's a shame that there isn't this function for everyone following an automatic unlock that didn't happen.

In an organization where there are a lot of people, it often happens that the person who initiated the automatic lock is not present:

  • late arrival
  • appointment
  • training
  • travel

... and is therefore unable to release the file at the request of another person (lack of time, or travelling and/or no connection, etc).

Is it not possible, at least from the ‘lock_timeout’ (30 minutes by default) onwards, for this forced unlock button to be accessible to everyone?

@Mika-6-9
Copy link

Mika-6-9 commented Feb 7, 2025

Is it not possible, at least from the ‘lock_timeout’ (30 minutes by default) onwards, for this forced unlock button to be accessible to everyone?

You can set a time from which the file is unlocked. This works very well on the server, but the information is not "sent" to the clients, the file remains locked on the PC (Windows).
It is impossible to force unlocking (while the file is no longer locked on the server) if you are not the user who locked the file.
This bug exists with "Client Push" enabled or not.
At a minimum, when you want to unlock a file, the client should ask the server for the file's lock status (even if it adds time because it is annoying not to be able to unlock locally a file that is no longer unlocked on the server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
Status: ☑️ Done
Development

Successfully merging this pull request may close these issues.

Please bring back the unlock feature
6 participants