Allow document locking to work with Autosave too #11606
Replies: 3 comments
-
Please add a reproduction in order for us to be able to investigate. Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided. Why was this issue marked with the
|
Beta Was this translation helpful? Give feedback.
-
Currently this is intended behaviour, document locking is there to prevent somebody editing data while you're still editing but the document is unlocked as soon as you save, which obviously with autosave is almost immediate. There's a few things we could do here to enhance this feature, such as providing manual locking controls and automatically locking on a timer for those with autosave. I will convert this into a discussion since it's not an actual bug with the functionality |
Beta Was this translation helpful? Give feedback.
-
I have enabled LivePreview for my Pages collection, which is very nice for the editors on my team when they are building out the website in the Pages collection. I have followed your website example, and have autosave enabled at a rather short interval to make the LivePreview feel snappy. The (therefore) lack of document locking doesn't feel very nice, since the admin panel doesn't auto-refresh the newest changes. This would turn it into multiplayer editing, which is an enterprise only feature, so I understand why this is a route you'd rather not go down. A way to lock a document when someone is opening it as suggested on Discord could work, but there might be other, better solutions to this – I haven't given it a lot of thought, just expressing my desire for a way to lock documents so multiple people don't edit the same document at the same time. The document might not need to be locked, but an indicator that someone has it open could work to discourage multiple people editing the same document without resorting to asking "are you editing page X?" on Teams for instance. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Bug
When Autosave is on, User 1 is able to access and edit the post being edited by User 2, which causes data loss.
From @PatrikKozak in Discord:
"So the way document locking works is once a user saves the document, we unlock the document. Based on the video above, I can see you have autosave enabled. So whenever you start editing, the document will lock but as soon as autosave fires, the document is unlocked."
Link to Discord thread : https://discord.com/channels/967097582721572934/1347546084683022437
Link to the code that reproduces this issue
Website template using Payload v3.27.0
Reproduction Steps
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
Beta Was this translation helpful? Give feedback.
All reactions