Skip to content

Document locking with multiple editors is not working with Autosave enabled #11604

@pranavks

Description

@pranavks

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

  1. Enable Autosave
  2. Test Document locking with multiple editors

Which area(s) are affected? (Select all that apply)

Not sure

Environment Info

Payload v3.27.0
Nextjs v15.2.0
Node v22.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions