Browser Client with no Peers is Pulling the updated data from Other Browser Clients with a Peer

83 Views Asked by At

I referred the following link for setting up the gun server instance in hello.js and browser client in index.html.

https://[github.com/amark/gun/wiki/getting-started-(v0.3.x)] While creating the hello.js i excluded the following code

var Gun = require('gun');
var gun = Gun();

with the following lines of code

// Our GUN setup from the last example.
var Gun = require('gun');
var gun = Gun({web: server});

while merging the snippets for hello.js I registered the server instance in localhost as peer in the index.html.First I invoked the index.html in 2 browser windows after starting the hello.js based gun server instance.I could observe the updates issued from each browser being reflected in both windows.Now I created a copy of index.html and removed the peer.The peer Array is now empty.But when I opened up this modified browser client I was able to see all the data from the server set up in the localhost in the console.How is this possible?How can a browser client with no peer get the data from other clients which has registered the peer.

Thanks in advance TEST

1

There are 1 best solutions below

0
On

I am guessing it was already saved to localStorage in the browser by a previous browser tab, and that they are both in the same session.

If you open it in an incognito browser tab (or another browser), do you still see the data?