mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
self check not needed?
This commit is contained in:
parent
9a5b824930
commit
e13ce8e4e3
2
gun.js
2
gun.js
@ -717,7 +717,7 @@
|
||||
&& !(root.pass||'')[cat.id]){ return } // if a new event listener was added, we need to make a pass through for it. The pass will be on the chain, not always the chain passed down.
|
||||
if(tmp = root.pass){ if(tmp[link+cat.id]){ return } tmp[link+cat.id] = 1 } // But the above edge case may "pass through" on a circular graph causing infinite passes, so we hackily add a temporary check for that.
|
||||
|
||||
(cat.id !== tat.id) && (tat.echo[cat.id] = cat); // set ourselfs up for an echo, but not if to self.
|
||||
(tat.echo[cat.id] = cat); // set ourself up for the echo! // TODO: BUG? Echo to self no longer causes problems? Confirm.
|
||||
|
||||
var sat = root.$.get(cat.link = tat.link = link)._; // grab what we're linking to.
|
||||
(sat.echo || (sat.echo = {}))[tat.id] = tat; // link it.
|
||||
|
@ -3581,7 +3581,7 @@ describe('Gun', function(){
|
||||
|
||||
});
|
||||
|
||||
it.only('users map map who said map on', function(done){
|
||||
it('users map map who said map on', function(done){
|
||||
this.timeout(1000 * 9);
|
||||
var gun = Gun();
|
||||
|
||||
@ -3643,7 +3643,7 @@ describe('Gun', function(){
|
||||
|
||||
});
|
||||
|
||||
it.only('get map should not slowdown', function(done){
|
||||
it('get map should not slowdown', function(done){
|
||||
this.timeout(5000);
|
||||
var gun = Gun({test_no_peer:true}).get('g/m/no/slow');
|
||||
//console.log("---------- setup data done -----------");
|
||||
@ -3651,25 +3651,25 @@ describe('Gun', function(){
|
||||
//var prev, diff, max = Infinity, total = 10000, largest = -1, gone = {};
|
||||
// TODO: It would be nice if we could change these numbers for different platforms/versions of javascript interpreters so we can squeeze as much out of them.
|
||||
gun.get('history').map().on(function(time, index){
|
||||
diff = Gun.time.is() - time;
|
||||
//console.log(">>>", index, time, diff);
|
||||
//return;
|
||||
diff = +new Date - time;
|
||||
//console.log(">>>", index, time, diff);return;
|
||||
expect(gone[index]).to.not.be.ok();
|
||||
gone[index] = diff;
|
||||
largest = (largest < diff)? diff : largest;
|
||||
expect(diff > max).to.not.be.ok();
|
||||
});
|
||||
//console.only.i=1;
|
||||
var turns = 0;
|
||||
var many = setInterval(function(){
|
||||
if(turns > total || (diff || 0) > (max + 5)){
|
||||
if(u === diff){ return }
|
||||
clearTimeout(many);
|
||||
expect(Gun.num.is(diff)).to.be.ok();
|
||||
expect('number' === typeof diff).to.be.ok();
|
||||
if(done.c){ return } done.c = 1;
|
||||
done();
|
||||
return;
|
||||
}
|
||||
prev = Gun.time.is();
|
||||
prev = +new Date;
|
||||
var put = {}; put[turns += 1] = prev;
|
||||
//console.log("put", put);
|
||||
//console.log("------", turns, "-------");
|
||||
|
Loading…
x
Reference in New Issue
Block a user