-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix: object lock #22408
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
base: 11.0/bugfixes
Are you sure you want to change the base?
Fix: object lock #22408
Conversation
|
I think I am missing something here. Where is the "users_id" field being set for the lock? |
3c3f99e to
9f41f6d
Compare
I do not know well this part; but it seems I do not understand is this issue comes from; there is no recent change on this file (or this is a very old issue?) |
It has been refactored in GLPI 11.0, see 6037279 |
Yeah, that's quite old... I had in mind I've tested objectlock a few weeks ago and did not have that issue - but maybe I'm wrong, or I tested another branch... Anyway, I can reproduce the issue; and the fix does not solve it :/
|
Yes, but that is after the condition the "else" was added to. IMO this feature has always had a little unreliability to it. In my testing, I see the I don't have a recommendation here at the moment. Obviously a SPA would have more control over the lifecycle of a "page" but that's not a feasible discussion for a while. |
|
So my problem was different, and solved by last commit. I do not know how to reproduce initial issue :/ |
|
The customer's issue was the same as the one you described:
|
Not exactly, on your screenshot the message is "Read-only mode"; which is another case in the template file |
|
At the client’s end, we see the message “Locked by...” (!41011 --> I did not share the screenshot to avoid exposing names). On my local instance, the message displayed is “Read-only mode.” In both cases, no other user is active on the object (or even in GLPI). However, GLPI still considers the object as locked, either by the user themselves (which should not block access) or by no one, indicating a potential issue with the lock declaration. |
Not sure the reason but having the message that an object is locked by you is expected in some cases. Are you sure the object is actually still locked though rather that what I described with the unlock request happening after the browser requests the page? |
Which ones? Honestly, the mechanics of locks are obscure, and the desired behavior is no clearer to me. |
Your guess is as good as mine but the functionality has existed as long as object locks themselves which means there was some intention there. |
|
The feature is probably due for a complete redesign |
|
In my view, the object lock is designed to prevent two people from editing the same item simultaneously, which could result in one user’s changes overwriting the other’s. If I am the owner of the lock, there is no valid reason for me to be blocked by myself. This appears to be a bug that has been present for many years. |
|
Isn't that to prevent usage in several browsers tab? |
|
I was only using it at the time, not developing 🤷♂️. I messaged the original author to try to get their thoughts on it. |
I agree with that👍 |
@tomolimo said that the object locked by yourself message was indeed for that reason. If you have the item open in multiple tabs, windows or even devices (maybe you start editing something from a phone and then finish when returning to your desk?), it is to prevent potential conflicts. |
|
I'm currently thinking that there is still no real short-term solution here to make the unlock request reliable when reloading/navigating away. These kinds of requests inside the I cannot think of a way to have the object lock check done/redone after the initial page render either without redoing how it is handled on the server as the session is modified if the item is locked when it is loaded which affects the form UI like hiding the edit button. |
I confirm that, as it was a feature requested initially About the issue, I'm not able to replicate it systematically But I can't replicate the lock on initial view of a computer, I still need to force refresh the page to have the issue. The current fix seems to remove the feature of multiple tabs open, and I don't know if it's widely used. About a full rework of the feature, I'm not convinced, as we can probably use our time on something more important. |
|
For information, the customer has tested and approved the patch. |
Checklist before requesting a review
Please delete options that are not relevant.
Description
Objects are systematically locked even when no one else is using them (only one user is using GLPI).