keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.64k stars 2.2k forks source link

Saving stale record data is allowed #4909

Open autoboxer opened 5 years ago

autoboxer commented 5 years ago

Expected behavior

  1. user a opens a record in the admin UI
  2. user b opens the same record in the admin UI, makes changes, and saves those changes
  3. user a makes changes to the record and saves those changes
  4. changes from user b remain and user a receives an error message suggesting that they were looking at an old version of the record and their changes can't be saved

Actual/Current behavior

  1. user a opens a record in the admin UI
  2. user b opens the same record in the admin UI, makes changes, and saves those changes
  3. user a makes changes to the record and saves those changes
  4. changes from user a are saved over changes from user b

Steps to reproduce the actual/current behavior

  1. create a model
  2. create an instance of that model
  3. open the instance of the model in your browser (we'll call this instance a)
  4. open another instance of the model in your browser( we'll call this instance b)
  5. make changes to the record in instance b and save the changes
  6. without reloading the page, make difference changes to the record in instance a and save the changes
  7. note that the changes from instance a overwrote the changes from instance b, and the save to the stale record was allowed

Environment

Software Version
Keystone 4.0.0
Node.js 9.11.2
Browser Chrome 73.0.3683.86 (64 bit)