58cd5e18 by Jabis Sevón

well this seems promising

1 parent 0e00439b
...@@ -1413,7 +1413,7 @@ ...@@ -1413,7 +1413,7 @@
1413 if(cat.jam){ return cat.jam.push([cb, as]) } 1413 if(cat.jam){ return cat.jam.push([cb, as]) }
1414 cat.jam = [[cb,as]]; 1414 cat.jam = [[cb,as]];
1415 gun.get(function go(msg, eve){ 1415 gun.get(function go(msg, eve){
1416 if(u === msg.put && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks <= tmp){ 1416 if(u === msg.put && !cat.root.opt.super && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks <= tmp){
1417 return; 1417 return;
1418 } 1418 }
1419 eve.rid(msg); 1419 eve.rid(msg);
...@@ -1811,7 +1811,7 @@ ...@@ -1811,7 +1811,7 @@
1811 } 1811 }
1812 if((tmp = eve.wait) && (tmp = tmp[at.id])){ clearTimeout(tmp) } 1812 if((tmp = eve.wait) && (tmp = tmp[at.id])){ clearTimeout(tmp) }
1813 eve.ack = (eve.ack||0)+1; 1813 eve.ack = (eve.ack||0)+1;
1814 if(!to && u === data && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return } 1814 if(!to && u === data && !at.root.opt.super && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return }
1815 if((!to && (u === data || at.soul || at.link || (link && !(0 < link.ack)))) 1815 if((!to && (u === data || at.soul || at.link || (link && !(0 < link.ack))))
1816 || (u === data && (tmp = Object.keys(at.root.opt.peers).length) && (!to && (link||at).ack < tmp))){ 1816 || (u === data && (tmp = Object.keys(at.root.opt.peers).length) && (!to && (link||at).ack < tmp))){
1817 tmp = (eve.wait = {})[at.id] = setTimeout(function(){ 1817 tmp = (eve.wait = {})[at.id] = setTimeout(function(){
...@@ -1819,7 +1819,7 @@ ...@@ -1819,7 +1819,7 @@
1819 }, opt.wait || 99); 1819 }, opt.wait || 99);
1820 return; 1820 return;
1821 } 1821 }
1822 if(link && u === link.put && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) } 1822 if(link && u === link.put && !at.root.opt.super && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) }
1823 eve.rid? eve.rid(msg) : eve.off(); 1823 eve.rid? eve.rid(msg) : eve.off();
1824 opt.ok.call(gun || opt.$, data, msg.get); 1824 opt.ok.call(gun || opt.$, data, msg.get);
1825 } 1825 }
...@@ -2062,7 +2062,7 @@ ...@@ -2062,7 +2062,7 @@
2062 Gun.log(err = (e || "localStorage failure") + " Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install"); 2062 Gun.log(err = (e || "localStorage failure") + " Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install");
2063 root.on('localStorage:error', {err: err, file: opt.prefix, flush: disk, retry: flush}); 2063 root.on('localStorage:error', {err: err, file: opt.prefix, flush: disk, retry: flush});
2064 } 2064 }
2065 //if(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers. 2065 if(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers.
2066 Gun.obj.map(ack, function(yes, id){ 2066 Gun.obj.map(ack, function(yes, id){
2067 if(yes){ 2067 if(yes){
2068 if(yes.more){ acks[id] = yes; return } 2068 if(yes.more){ acks[id] = yes; return }
......
1 function Nomem(){ 1 function Nomem(){
2 var opt = {}, u; 2 var opt = {}, u;
3 opt.put = function(file, data, cb){ cb(null, -9) }; // dev/null! 3 opt.put = function(file, data, cb){ cb(null, -9) }; // dev/null!
4 opt.get = function(file, cb){ cb(null,-9) }; 4 opt.get = function(file, cb){ cb(null) };
5 return opt; 5 return opt;
6 } 6 }
7 if(typeof window !== "undefined"){ 7 if(typeof window !== "undefined"){
8 window.Nomem = Nomem; 8 window.Nomem = Nomem;
9 } else { 9 } else {
10 try{ module.exports = Nomem }catch(e){} 10 try{ module.exports = Nomem }catch(e){}
11 } 11 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -255,11 +255,7 @@ ...@@ -255,11 +255,7 @@
255 g.file = file || (file = opt.code.from); 255 g.file = file || (file = opt.code.from);
256 DBG && (DBG = DBG[file] = DBG[file] || {}); 256 DBG && (DBG = DBG[file] = DBG[file] || {});
257 DBG && (DBG.rf = DBG.rf || +new Date); 257 DBG && (DBG.rf = DBG.rf || +new Date);
258 if(tmp = r.disk[g.file = file]){ 258 if(tmp = r.disk[g.file = file]){ g.check(u, tmp); return }
259 console.log("checking",opt,u,tmp,g.check(u,tmp));
260 g.check(u, tmp);
261 if(!opt.ackRelentless) return
262 }
263 r.parse(file, g.check, u, DBG); 259 r.parse(file, g.check, u, DBG);
264 } 260 }
265 g.get = function(err, disk, info){ 261 g.get = function(err, disk, info){
...@@ -270,10 +266,9 @@ ...@@ -270,10 +266,9 @@
270 if(!disk && file !== opt.code.from){ // corrupt file? 266 if(!disk && file !== opt.code.from){ // corrupt file?
271 r.find.bad(file); // remove from dir list 267 r.find.bad(file); // remove from dir list
272 r.read(key, cb, o); // try again 268 r.read(key, cb, o); // try again
273 if(!opt.ackRelentless) return; 269 return;
274 } 270 }
275 disk = r.disk[file] || (r.disk[file] = disk); 271 disk = r.disk[file] || (r.disk[file] = disk);
276
277 if(!disk){ cb(file === opt.code.from? u : "No file!"); return } 272 if(!disk){ cb(file === opt.code.from? u : "No file!"); return }
278 disk.file || (disk.file = file); 273 disk.file || (disk.file = file);
279 var data = r.range(disk(key), o); 274 var data = r.range(disk(key), o);
...@@ -580,4 +575,4 @@ ...@@ -580,4 +575,4 @@
580 575
581 Radisk.Radix = Radix; 576 Radisk.Radix = Radix;
582 577
583 }()); 578 }());
...\ No newline at end of file ...\ No newline at end of file
......
1 { 1 {
2 "_args": [ 2 "_from": "gun@^0.2020.430",
3 [
4 "gun@0.2020.430",
5 "/home/coder/.ncsapps/gun-multiserver"
6 ]
7 ],
8 "_from": "gun@0.2020.430",
9 "_id": "gun@0.2020.430", 3 "_id": "gun@0.2020.430",
10 "_inBundle": false, 4 "_inBundle": false,
11 "_integrity": "sha512-mCRrz/VUflCGaRVOA4pTnRo5YSP5pa0lpSszqQ6offJQC9PzClvl2aofpaaHOXx5rFzw34HP/EjWZP3cxen3gQ==", 5 "_integrity": "sha512-mCRrz/VUflCGaRVOA4pTnRo5YSP5pa0lpSszqQ6offJQC9PzClvl2aofpaaHOXx5rFzw34HP/EjWZP3cxen3gQ==",
12 "_location": "/gun", 6 "_location": "/gun",
13 "_phantomChildren": {}, 7 "_phantomChildren": {},
14 "_requested": { 8 "_requested": {
15 "type": "version", 9 "type": "range",
16 "registry": true, 10 "registry": true,
17 "raw": "gun@0.2020.430", 11 "raw": "gun@^0.2020.430",
18 "name": "gun", 12 "name": "gun",
19 "escapedName": "gun", 13 "escapedName": "gun",
20 "rawSpec": "0.2020.430", 14 "rawSpec": "^0.2020.430",
21 "saveSpec": null, 15 "saveSpec": null,
22 "fetchSpec": "0.2020.430" 16 "fetchSpec": "^0.2020.430"
23 }, 17 },
24 "_requiredBy": [ 18 "_requiredBy": [
25 "/" 19 "/"
26 ], 20 ],
27 "_resolved": "https://registry.npmjs.org/gun/-/gun-0.2020.430.tgz", 21 "_resolved": "https://registry.npmjs.org/gun/-/gun-0.2020.430.tgz",
28 "_spec": "0.2020.430", 22 "_shasum": "ffc13b1109be253ea91270eb9f10d75c66a25e3e",
23 "_spec": "gun@^0.2020.430",
29 "_where": "/home/coder/.ncsapps/gun-multiserver", 24 "_where": "/home/coder/.ncsapps/gun-multiserver",
30 "android": "browser.android.js", 25 "android": "browser.android.js",
31 "author": { 26 "author": {
...@@ -35,6 +30,7 @@ ...@@ -35,6 +30,7 @@
35 "bugs": { 30 "bugs": {
36 "url": "https://github.com/amark/gun/issues" 31 "url": "https://github.com/amark/gun/issues"
37 }, 32 },
33 "bundleDependencies": false,
38 "dependencies": { 34 "dependencies": {
39 "buffer": "^5.4.3", 35 "buffer": "^5.4.3",
40 "bufferutil": "^4.0.1", 36 "bufferutil": "^4.0.1",
...@@ -44,6 +40,7 @@ ...@@ -44,6 +40,7 @@
44 "utf-8-validate": "^5.0.2", 40 "utf-8-validate": "^5.0.2",
45 "ws": "^7.2.1" 41 "ws": "^7.2.1"
46 }, 42 },
43 "deprecated": false,
47 "description": "A realtime, decentralized, offline-first, graph data synchronization engine.", 44 "description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
48 "devDependencies": { 45 "devDependencies": {
49 "@types/ip": "^1.1.0", 46 "@types/ip": "^1.1.0",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!