Skip to content

Initiate Data Handshake on Reconnect #259

Description

@PsychoLlama

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);
  1. Open http://you-server-ip-address:8080/todo/index.html on two computers.
  2. Add some todos, they should sync.
  3. Take one computer offline and add some todos.
  4. Take it back online and add more todos.
    You should notice that only the todos created while online were synced in real-time.
  5. Refresh that browser, and the offline todos should (finally) replicate.

Props to @nevf for finding this bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions