graphiti-api/spraypaint.js

Object-type attributes will always be dirty no matter if they are modified or not

Opened this issue · 0 comments

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:

} else if (prior !== current) {

Update to JSON.stringify(prior) !== JSON.stringify(current) would solve the problem.

Also, this similar issue here:

if (self[k] !== attrs[k] && !changes[k]) {

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.