For some reason here it breaks if I use Object.assign but not if I copy the values to pos_state individually. I can't work out why this is because I can't reproduce it in a sandbox. As far as I understand Object.assign mutates the target object *and* returns a new object, so the the target object should be persistent since it's never being overwritten. Not sure what I'm overlooking