gun icon indicating copy to clipboard operation
gun copied to clipboard

Test for bug-673: Can't replace data by setting fields to null, GUN m…

Open rogowski opened this issue 5 years ago • 2 comments

…erges the new object

rogowski avatar Jan 21 '20 23:01 rogowski

issue #673

rogowski avatar Jan 23 '20 00:01 rogowski

@rogowski so (if I understand this test right) I think this behavior is changing in 2020 with the new "more predictable souls" for better offline conflict merges.

gun get a . b . c = {z: 9} gun get a .b = null gun get a . b . c = {x: 2} read: {z: 9, x: 2}

This will/now be the intended default behavior.

To force a new object you'll need to do

var ref = gun get "randomTopLevelName" = {} gun get a . b = ref // instead of null & new obj

To manually force re-assigning to a new soul that hasn't been used before.

If this is relevant to this test, can we update it accordingly & hopefully it'll pass & can merge?

Thanks again for your wonderful work! :)

amark avatar May 16 '20 10:05 amark