plone / plone/plone.restapi

Add a way to unlock content while saving it

Open
#2,003 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

04 type: enhancement
Dominant language
Python
Stars
109
Forks
107
Avg merge
2d 3h
Merged PRs (30d)
4

Description

Currently when an item is saved in Volto, it makes 2 separate requests: one to update the content, and one to unlock it.

  1. User clicks save
  2. Volto sends a PATCH to the content URL and a POST to [content url]/@unlock
  3. When the PATCH is done, Volto navigates back to the content view, which does a GET of the content URL

If the unlock has not yet finished at step 3, some actions might not be available yet in the GET response, since the content is still locked.

To avoid this, we can add a way to unlock the content in the same transaction where it is updated. Maybe an X-Plone-Unlock header or something.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the save sequence described in the issue: the PATCH to the content URL, the POST to [content url]/@unlock, and the subsequent GET. Determine how the REST API could combine updating and unlocking so the following content view cannot observe a still-locked item. Done means the update and unlock are coordinated through a defined API mechanism and the race described no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.