Object-type attributes will always be dirty no matter if they are modified or not
Opened this issue · 0 comments
limbov8 commented
Hi, when I try to update a model, it will send all object attributes to server which is not really ideal since sometimes objects are huge and donot meant to be updated.
Found this line of code here:
spraypaint.js/src/util/dirty-check.ts
Line 63 in af9493e
Update to JSON.stringify(prior) !== JSON.stringify(current)
would solve the problem.
Also, this similar issue here:
Line 475 in af9493e
Inside self[k] !== attrs[k] && !changes[k]
, if an attribute is an object, self[k] !== attrs[k]
might always return true and !changes[k]
will always return false. So, model.ts#L480 will never happen.