uuid fix (?) for @go1dfish

This commit is contained in:
Mark Nadal
2019-07-27 19:43:19 -07:00
parent e1ae0158a4
commit cc276a6862
2 changed files with 3 additions and 3 deletions

4
gun.js
View File

@@ -802,6 +802,7 @@
Gun.on.get = function(msg, gun){
var root = gun._, get = msg.get, soul = get[_soul], node = root.graph[soul], has = get[_has], tmp;
var next = root.next || (root.next = {}), at = next[soul];
// queue concurrent GETs?
if(!node){ return root.on('get', msg) }
if(has){
if('string' != typeof has || !obj_has(node, has)){ return root.on('get', msg) }
@@ -1483,7 +1484,6 @@
}, as);
if(as.res){ as.res() }
} function no(v,k){ if(v){ return true } }
//console.debug(999,1); var C = 0; setInterval(function(){ try{ debug.innerHTML = C }catch(e){console.log(e)} }, 500);
function map(v,k,n, at){ var as = this;
var is = Gun.is(v);
@@ -1513,7 +1513,7 @@
id = at.dub = at.dub || id || Gun.node.soul(cat.obj) || Gun.node.soul(msg.put || at.put) || Gun.val.link.is(msg.put || at.put) || (as.via.back('opt.uuid') || Gun.text.random)(); // TODO: BUG!? Do we really want the soul of the object given to us? Could that be dangerous?
if(eve){ eve.stun = true }
if(!id){ // polyfill async uuid for SEA
at.via.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback
as.via.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback
if(err){ return Gun.log(err) } // TODO: Handle error.
solve(at, at.dub = at.dub || id, cat, as);
});

View File

@@ -1,6 +1,6 @@
{
"name": "gun",
"version": "0.2019.712",
"version": "0.2019.726",
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
"main": "index.js",
"browser": "gun.js",