[go: up one dir, main page]

Skip to content

Add originalBody parameter to update note api

When we are updating the note via the API, we don't have any way to prevent data lose. In this issue, we introduce a new optional parameter called original_body, which is used to check the note has not been updated since the client sending the api request has last seen the note.

Steps to reproduce

  1. Read the note as user A, user A thinks that body is 1234
  2. Read the note as user B, user B thinks that body is 1234
  3. User A submits a updateNote mutation and changes the body to abcde
  4. User B submits an updateNote changes the body to wxyz **without having a chance of knowing they are overriding data they've never seen.

Related to: #323808