keystonejs / keystone-classic

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

Saving before Relationship many:true fields load clears out all saved Relationships #4919

Closed autoboxer closed 4 years ago

autoboxer commented 5 years ago

Expected behavior

Saving a model before all Relationships in a Relationship many:true field have had a chance to load in won't affect currently saved data in that field.

Actual/Current behavior

Saving a model before Relationships in a Relationship many:true field have had a chance to load in saves the model without any unpopulated relationship data.

Steps to reproduce the actual/current behavior

  1. Create a model with a Relationship many:true field
  2. Add related models via the Relationship field
  3. Open Chrome dev tools and use throttling to mimic a slower connection (slow 3g recommended)
  4. Load the model in the admin UI, and click Save before the Relationship field can populate
  5. Note that all previously saved models in the Relationship field are now missing

Environment

Software Version
Keystone 4.0.0
Node.js 11.14.0 and 12.1.0
Browser Chrome 74.0.3729.131