diff --git a/.gitignore b/.gitignore index 5a1e39c8..b200f1e9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ node_modules/* npm-debug.log *data.json *.db -.idea/ \ No newline at end of file +.idea/ +*.bak +*.new \ No newline at end of file diff --git a/gun.js b/gun.js index 349b27fa..141b747d 100644 --- a/gun.js +++ b/gun.js @@ -559,6 +559,7 @@ if(!opt.end && Gun.obj.empty(delta, Gun._.meta)){ return } if($$.key){ node = Gun.union.pseudo($.key, gun.__.key.s[$.key]) || node } if(opt.change){ node = delta || node } + //root.console.log("ON IT BABY!", $$, node); cb.call($$.gun || gun, Gun.obj.copy($$.field? node[$$.field] : node), $$.field || $$.at); })(gun.__.graph[$.soul], $); if(!opt.once){ gun.__.on($.soul).event(ctx[$.soul]) } diff --git a/test/common.js b/test/common.js index dbcc5f10..16e177d1 100644 --- a/test/common.js +++ b/test/common.js @@ -1836,6 +1836,19 @@ describe('Gun', function(){ }); }) }); + + it("gun put null path on put sub object", function(done){ // consensus4's bug + var gun = Gun(); + //Gun.log.verbose = true; + var game = gun.put({board: null, teamA: null, teamB: null, turn: null}).key('the/game'); + game.path('board').on(function(board){ + console.log("board updated", board); + }); + setTimeout(function(){ + //game.path('board').put({11: ' ', 22: ' ', 33: 'A'}); + game.put({board: {11: ' ', 22: ' ', 33: 'A'}}); + },100); + }); }); describe('Streams', function(){ diff --git a/web/img/Thumbs.db b/web/img/Thumbs.db index 2699a75f..a146854d 100644 Binary files a/web/img/Thumbs.db and b/web/img/Thumbs.db differ