You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
limbov8
changed the title
Object Type attributes will always be dirty no matter it modified or not
Object-type attributes will always be dirty no matter if they are modified or not
Dec 6, 2019
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:
spraypaint.js/src/model.ts
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.The text was updated successfully, but these errors were encountered: