TL;DR: if you make changes when offline, they won't be propagated upon reconnection.
Gun version 0.3.998, the latest on npm.
Replicating the bug
In the examples folder, make some changes to allow other computers to connect:
todo/index.html
Naturally, localhost won't work from another computer.
// Line #14
-var gun = Gun(location.origin + '/gun');
+var gun = Gun('http://your-ip-address:8080/gun')
http.js
Allows other computers to connect via IP address.
// Line #28
-server.listen(port, ip);
+server.listen(port);
- Open
http://you-server-ip-address:8080/todo/index.html on two computers.
- Add some todos, they should sync.
- Take one computer offline and add some todos.
- Take it back online and add more todos.
You should notice that only the todos created while online were synced in real-time.
- Refresh that browser, and the offline todos should (finally) replicate.
Props to @nevf for finding this bug!
TL;DR: if you make changes when offline, they won't be propagated upon reconnection.
Replicating the bug
In the examples folder, make some changes to allow other computers to connect:
todo/index.htmlNaturally,
localhostwon't work from another computer.http.jsAllows other computers to connect via IP address.
http://you-server-ip-address:8080/todo/index.htmlon two computers.You should notice that only the todos created while online were synced in real-time.
Props to @nevf for finding this bug!