fission icon indicating copy to clipboard operation
fission copied to clipboard

Server WNFS Conflict Detection

Open expede opened this issue 4 years ago • 0 comments

NB: Feature requests will only be considered if they solve a pain

Summary

Problem

Updates may drop data:

  1. Dropping history (overwriting revisions)
  2. Forgetting files in the latest generation when reconciling with new data

There is a client-side conflict resolution portion of this, which must be shipped first: https://github.com/fission-suite/webnative/issues/163

Impact

Losing files is a terrible experience

Solution

Enforce that data is persistent, and can only be accreted, not overwritten (unless the UCAN is set as SUPER_USER).

This is a simplified version of what the front-end does (spec). The server needs to check that the incoming changes do not overwrite existing data, and if it does diverge, refuse the update.

On update, make sure that the new version strictly contains the public and private sides On collision, reject with all of the following:

  1. HTTP 428
  2. The latest "head" CID (i.e. existing DNSLink)
  3. The divergent CIDs (one public & potentially many private)

428 Precondition Required (RFC 6585) The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.[59]

expede avatar Jan 13 '21 05:01 expede