api icon indicating copy to clipboard operation
api copied to clipboard

Store document diffs

Open mingard opened this issue 8 years ago • 1 comments

Overview

On Top of the existing history collection, which is useful for auditing at DB level, introduce a diff collection to handle unpublished changes.

Features

  • Store diff document in a separate collection
  • Flag published state on each diff document
  • Apply unpublished diffs based on ?includeDiffs=true flag on GET query
  • Apply all diffs and save to original document with a single call to the document endpoint

Benefits

  • Introduces a draft state to all documents
  • Can be used in web for a preview instance
  • Introduces a reliable changelog view
  • Removes the need to retain all history

Questions for the floor

  • How do we handle hooks? Do compile the diffs before handing to a hook if includeDiffs is present on POST and PUT?
  • Can a PUT request be made to a document that has outstanding diffs

mingard avatar Oct 19 '17 11:10 mingard

@abovebored @jimlambie and @josephdenne as discussed yesterday.

@eduardoboucas hooks question for you :)

mingard avatar Oct 19 '17 11:10 mingard