nextcloud / nextcloud/cookbook

ETag system for protection of changes in concurrent editing scenarios

Open
#420 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
HTML
Stars
641
Forks
113
Avg merge
21h 31m
Merged PRs (30d)
26

Description

Is your feature request related to a problem? Please describe.
Currently, if the app is opened in multiple devices/browsers, all have their local storage. Changes can be made but are of course not propagated to other devices.
Changes made by device A can be overwritten by changes made on device B if B is saved after A was saved.

Describe the solution you'd like
There should be an ETag (a hash sum of the recipe's data) that is to be transmitted to the frontend and be returned 1:1 to the backend. If concurrent changes have happened the ETag on the server has changed so the new changes (made by B in the example above) will be rejected by the backend.

The exact structure of the error resolution needs to be defined.

Describe alternatives you've considered
Hard locking of recipes but this contradicts the REST principles.

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

No files or tests are named. Start by tracing the recipe read and save API paths in the repository, then define the ETag and conflict response behavior for concurrent edits. Done means the behavior is specified and covered by tests showing that an outdated save is rejected without overwriting newer data.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.