58cd5e18 by Jabis Sevón

well this seems promising

1 parent 0e00439b
......@@ -1413,7 +1413,7 @@
if(cat.jam){ return cat.jam.push([cb, as]) }
cat.jam = [[cb,as]];
gun.get(function go(msg, eve){
if(u === msg.put && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks <= tmp){
if(u === msg.put && !cat.root.opt.super && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks <= tmp){
return;
}
eve.rid(msg);
......@@ -1811,7 +1811,7 @@
}
if((tmp = eve.wait) && (tmp = tmp[at.id])){ clearTimeout(tmp) }
eve.ack = (eve.ack||0)+1;
if(!to && u === data && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return }
if(!to && u === data && !at.root.opt.super && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return }
if((!to && (u === data || at.soul || at.link || (link && !(0 < link.ack))))
|| (u === data && (tmp = Object.keys(at.root.opt.peers).length) && (!to && (link||at).ack < tmp))){
tmp = (eve.wait = {})[at.id] = setTimeout(function(){
......@@ -1819,7 +1819,7 @@
}, opt.wait || 99);
return;
}
if(link && u === link.put && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) }
if(link && u === link.put && !at.root.opt.super && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) }
eve.rid? eve.rid(msg) : eve.off();
opt.ok.call(gun || opt.$, data, msg.get);
}
......@@ -2062,7 +2062,7 @@
Gun.log(err = (e || "localStorage failure") + " Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install");
root.on('localStorage:error', {err: err, file: opt.prefix, flush: disk, retry: flush});
}
//if(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers.
if(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers.
Gun.obj.map(ack, function(yes, id){
if(yes){
if(yes.more){ acks[id] = yes; return }
......
function Nomem(){
var opt = {}, u;
opt.put = function(file, data, cb){ cb(null, -9) }; // dev/null!
opt.get = function(file, cb){ cb(null,-9) };
opt.get = function(file, cb){ cb(null) };
return opt;
}
if(typeof window !== "undefined"){
......
......@@ -255,11 +255,7 @@
g.file = file || (file = opt.code.from);
DBG && (DBG = DBG[file] = DBG[file] || {});
DBG && (DBG.rf = DBG.rf || +new Date);
if(tmp = r.disk[g.file = file]){
console.log("checking",opt,u,tmp,g.check(u,tmp));
g.check(u, tmp);
if(!opt.ackRelentless) return
}
if(tmp = r.disk[g.file = file]){ g.check(u, tmp); return }
r.parse(file, g.check, u, DBG);
}
g.get = function(err, disk, info){
......@@ -270,10 +266,9 @@
if(!disk && file !== opt.code.from){ // corrupt file?
r.find.bad(file); // remove from dir list
r.read(key, cb, o); // try again
if(!opt.ackRelentless) return;
return;
}
disk = r.disk[file] || (r.disk[file] = disk);
if(!disk){ cb(file === opt.code.from? u : "No file!"); return }
disk.file || (disk.file = file);
var data = r.range(disk(key), o);
......
{
"_args": [
[
"gun@0.2020.430",
"/home/coder/.ncsapps/gun-multiserver"
]
],
"_from": "gun@0.2020.430",
"_from": "gun@^0.2020.430",
"_id": "gun@0.2020.430",
"_inBundle": false,
"_integrity": "sha512-mCRrz/VUflCGaRVOA4pTnRo5YSP5pa0lpSszqQ6offJQC9PzClvl2aofpaaHOXx5rFzw34HP/EjWZP3cxen3gQ==",
"_location": "/gun",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "gun@0.2020.430",
"raw": "gun@^0.2020.430",
"name": "gun",
"escapedName": "gun",
"rawSpec": "0.2020.430",
"rawSpec": "^0.2020.430",
"saveSpec": null,
"fetchSpec": "0.2020.430"
"fetchSpec": "^0.2020.430"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/gun/-/gun-0.2020.430.tgz",
"_spec": "0.2020.430",
"_shasum": "ffc13b1109be253ea91270eb9f10d75c66a25e3e",
"_spec": "gun@^0.2020.430",
"_where": "/home/coder/.ncsapps/gun-multiserver",
"android": "browser.android.js",
"author": {
......@@ -35,6 +30,7 @@
"bugs": {
"url": "https://github.com/amark/gun/issues"
},
"bundleDependencies": false,
"dependencies": {
"buffer": "^5.4.3",
"bufferutil": "^4.0.1",
......@@ -44,6 +40,7 @@
"utf-8-validate": "^5.0.2",
"ws": "^7.2.1"
},
"deprecated": false,
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
"devDependencies": {
"@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!