Open brailateo opened 1 year ago
it should be defaulting to 60 retries, no? But you're saying an opt||
bug causes it to only retry 1? That sounds bad. Please send PR! (tho please don't let it infinitely retry)
I'm sorry @amark but I cannot send a PR because:
Best regards, Teo
Found bug in gun.js that can be found today at https://cdn.jsdelivr.net/npm/gun/gun.js In function reconnect(peer) , after line 1777 ( clearTimeout(peer.defer); ) I added a single line console.log("I'm in reconnect, opt=",opt); After 1 reconnect attempt you fill find the opt variable empty {} so the reconnect function will NEVER be called again because of the next line: if(!opt.peers[peer.url]){ return }
So I just comment out that line and everything is OK!
Test procedure AFTER operating my hack:
Your app document updates during network failure simulation ARE saved in local storage of browsers, they are NOT automatically pushed to other peers or super-peer upon reconnection but I'm feeling that it's not possible, yet! Anyway, I found a "TODO: resync upon reconnect online/offline" at line 1734 and I suppose that it might be possible sometime? Anyway, updates during offline time are delivered to other peers from local storage WHEN REQUESTED by other peers, so it's not a show-stopper, probably apps should be designed with periodically auto-refresh.
Best regards, Teo