From bd0e6a615fc53c705a2299dbb8b71af77f4c147f Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Tue, 3 Jan 2017 09:40:47 -0800 Subject: [PATCH 1/4] Update gun.js --- gun.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gun.js b/gun.js index effa3f6a..1c08c0fb 100644 --- a/gun.js +++ b/gun.js @@ -1130,6 +1130,10 @@ return; } if(HAM.defer){ // TODO: BUG! Not implemented. + union[field] = value; // WRONG! BUG! Need to implement correct algorithm. + state_ify(union, field, is); // WRONG! BUG! Need to implement correct algorithm. + // filler algorithm for now. + return; /*upper.wait = true; opt.upper.call(state, vertex, field, incoming, ctx.incoming.state); // signals that there are still future modifications. Gun.schedule(ctx.incoming.state, function(){ From 8c426553d77a5f234879d8da7e726ff710f578bd Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Wed, 11 Jan 2017 10:38:10 -0800 Subject: [PATCH 2/4] Update gun.js --- gun.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gun.js b/gun.js index 1c08c0fb..0814f5d0 100644 --- a/gun.js +++ b/gun.js @@ -2448,7 +2448,7 @@ function request (peers, ctx) { if (Client.isSupported) { - Client.broadcast(peers, { body: ctx }); + Client.broadcast(peers, ctx); } } @@ -2457,13 +2457,14 @@ var gun = ctx.gun; var peers = gun.Back('opt.peers') || {}; + var headers = gun.Back('opt.headers') || {}; // Validate. if (Gun.obj.empty(peers)) { return; } - request(peers, ctx); + request(peers, {body: ctx, headers: headers}); }); request.jsonp = function (opt, cb) { From baf99d7e723575fceb96b82116572f5e9a314ff2 Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Wed, 11 Jan 2017 10:47:50 -0800 Subject: [PATCH 3/4] Update client.js --- lib/wsp/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wsp/client.js b/lib/wsp/client.js index 62b6e8d3..c10f7547 100644 --- a/lib/wsp/client.js +++ b/lib/wsp/client.js @@ -49,6 +49,7 @@ Gun.on('out', function (ctx) { var gun = ctx.gun; var opt = ctx.opt || {}; var peers = opt.peers || gun.Back('opt.peers'); + var headers = opt.headers || gun.Back('opt.headers') || {}; if (!peers) { return; @@ -56,8 +57,9 @@ Gun.on('out', function (ctx) { var subset = getSocketSubset(peers); + headers['gun-sid'] = sid; subset.send({ - headers: { 'gun-sid': sid }, + headers: headers, body: ctx, }); }); From e141a4c2409f8c157ad093957e1bd7a929294783 Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Fri, 20 Jan 2017 20:30:19 -0800 Subject: [PATCH 4/4] Update gun.js --- gun.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gun.js b/gun.js index 0814f5d0..19bc2681 100644 --- a/gun.js +++ b/gun.js @@ -591,14 +591,14 @@ Node.is = function(n, cb, o){ var s; // checks to see if an object is a valid node. if(!obj_is(n)){ return false } // must be an object. if(s = Node.soul(n)){ // must have a soul on it. - return !obj_map(n, map, {o:o,n:n,cb:cb}); + return !obj_map(n, map, {o:o,cb:cb,s:s,n:n}); } return false; // nope! This was not a valid node. } function map(v, f){ // we invert this because the way we check for this is via a negation. if(f === Node._){ return } // skip over the metadata. if(!Val.is(v)){ return true } // it is true that this is an invalid node. - if(this.cb){ this.cb.call(this.o, v, f, this.n) } // optionally callback each field/value. + if(this.cb){ this.cb.call(this.o, v, f, this.s, this.n) } // optionally callback each field/value. } }()); ;(function(){