486 Commits

Author SHA1 Message Date
Mark Nadal
7291263426 repull and test 2016-12-30 19:23:16 -08:00
d3x0r
751ac3b230 pass wsc options to client gun create ( wsc:protocols especially, since that translates to the optional parameter in the standard client websocket constructor ) 2016-12-21 15:03:10 -08:00
Mark Nadal
631eb6d023 mostly working solution to orphan-child-unsubscribe-from-table problem, although causality questions, going to try another idea. 2016-12-19 23:58:30 -08:00
Mark Nadal
2e7b87c3b9 Update gun.js 2016-12-19 20:57:07 -08:00
Mark Nadal
44fa4f3252 Update gun.js 2016-12-19 20:30:42 -08:00
Mark Nadal
5ade1b6773 idea for solution 2016-12-17 23:54:32 -08:00
Mark Nadal
bdcea8c0d1 Update gun.js 2016-12-17 21:56:15 -08:00
Mark Nadal
ef89785525 Update gun.js 2016-12-17 14:01:58 -08:00
Mark Nadal
53d5417d4a Update gun.js 2016-12-17 12:25:36 -08:00
Mark Nadal
02381a123d so much 2016-12-15 16:17:50 -08:00
Jesse Gibson
a566572a2d Shallow copy constructor options
Previously constructor options were deeply copied, which caused
issues with 3rd party plugins when they pass "class" instances as
options (since instances were copied into POJOs, breaking the prototype
chain). Now it's shallow copied. Special treatment is still given for
the `peers` property.
2016-12-15 15:35:11 -07:00
Jesse Gibson
ba673f73f8 Attempt reconnect on disconnect
Previously, the client websocket layer would only attempt a reconnection
if there were pending messages in the queue. Now it will always attempt
a reconnection, solving most of issue #259 (although not completely, as
reconnects are susceptible to race conditions).
2016-12-13 13:37:43 -07:00
Jesse Gibson
304265e193 Pass backoff options from constructor
The Client constructor supports backoff configuration. This commit
exposes it to the end developer via the `peers` options object, in the
`backoff` property.
Example:

Gun({
  peers: {
    'url.com/gun': {
      backoff: { max: 1000, factor: 0.2 }
    }
  }
})
2016-12-12 16:24:51 -07:00
Jesse Gibson
30fe844cab Check JSON support just once
Two separate modules (localStorage & websockets) ensured JSON was
globally defined. Since only one is needed to alert the user, the
other has been removed.
2016-12-12 16:10:39 -07:00
Jesse Gibson
bb65acab10 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-12-12 15:12:41 -07:00
Jesse Gibson
01c93157cb Fix msg passing, add reconnect & backoff
Fixed broadcast storm caused by re-enveloping the same message and
re-emitting it (I passed the envelope to gun, not just the msg body).
Sockets will attempt an exponential reconnect if the message queue isn't
empty, otherwise they're still just lazy bums that only open when
needed.
JSONP wasn't working before I took on this project, but now it's
completely disconnected. Once it's working, it should go in the
`request` function as a websocket fallback.
2016-12-12 14:37:09 -07:00
Mark Nadal
9f7acfd27f Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-12-09 18:20:45 -08:00
Mark Nadal
0779e32544 merged? Maybe? 2016-12-09 18:20:16 -08:00
Mark Nadal
69d1e81fc9 Update gun.js 2016-12-09 18:13:25 -08:00
Mark Nadal
34eb293a63 be brave, clean up 2016-12-06 23:48:10 -08:00
Jesse Gibson
b352cd742a Update client WebSocket plugin
Lovely little abstraction layer over websockets sends messages using
gun's new envelope system. Exponential backoff has not been
implemented yet. If the socket fails to connect, it won't retry (yet).
Also, this update left some dead code with the jsonp implementation.
Soon that should be ported over to the new envelope system too, but now
it's disconnected from gun.
2016-12-01 16:51:35 -07:00
Mark Nadal
dd72a24740 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-11-29 20:20:32 -08:00
Mark Nadal
111d0f5bda instance specific dedup for @d3x0r 2016-11-29 20:19:59 -08:00
Mark Nadal
bd960b4d67 thanks to @Stefdv #284 2016-11-29 11:35:20 -08:00
Mark Nadal
ce32d8414b ahem, thank you d3x0r 2016-11-28 20:31:27 -08:00
Mark Nadal
3e2bf996fa final touches 2016-11-28 19:40:39 -08:00
Mark Nadal
9abe3fb75f fix for d3x0r and Stefdv 2016-11-28 17:57:20 -08:00
Jesse Gibson
4848493530 Add envelope-system server sync
Using gun's new envelope system (where routing and de-duplication happen
inside gun core), server-to-server synchronization has been
implemented.
However, it comes with this warning: the chain isn't yet ready and
you'll have difficulty reading or writing data via the chain.
2016-11-25 14:42:44 -07:00
Jesse Gibson
9d9dea2553 Add envelope plugin system
@amark made these changes, I'm just committing them.
2016-11-25 09:49:48 -07:00
Mark Nadal
c8e919f287 fix chain 2016-11-22 18:07:49 -08:00
Mark Nadal
92103e0767 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-11-16 21:22:58 -08:00
Mark Nadal
bfd1107e61 merge again 2016-11-16 21:22:55 -08:00
Cole Albon
86a5abd550 #271 one liner fix error while assigning console 2016-11-16 19:14:31 -07:00
Mark Nadal
7c2c52d235 Merge branch '0.5' of https://github.com/amark/gun into 0.5 2016-11-15 14:40:30 -08:00
Mark Nadal
914cce726b merge again 2016-11-15 14:40:27 -08:00
Mark Nadal
126a668bf3 Update gun.js 2016-11-15 14:39:24 -08:00
Mark Nadal
6b054146c8 attempted merge with @alancnet 's awesomeness! 2016-11-14 16:53:33 -08:00
Mark Nadal
1966a09ac2 mid conflict merge 2016-11-14 16:44:00 -08:00
Mark Nadal
8bb003e311 getting back from Italy... 2016-11-14 16:34:28 -08:00
Mark Nadal
fe624166cc fix #263 for @imomin and limit back off 2016-11-13 10:05:03 -08:00
Mark Nadal
24a6c858a2 Merge pull request #254 from alancnet/off-0.5
.off for .on, and .map. (0.5)
2016-11-10 16:39:45 -08:00
Jesse Gibson
878dad4153 Fix reconnection replication
Fixes issue #259, where edits made offline wouldn't be queued for when a
socket comes back online.
I didn't quite follow the logic of the previous queuing system, so I
refined it and the issue was fixed, so.... yay!
2016-11-02 15:08:05 -06:00
Alan Colon
281a56292e .off for .on, and .map. (0.5) 2016-10-23 20:02:28 -06:00
Alan Colon
74b0242682 Enable .set with node, or new soul. (0.5) 2016-10-23 16:45:39 -06:00
Mark Nadal
c006690ced Merge pull request #252 from alancnet/off
.off for .on, .map, and .path
2016-10-23 23:39:49 +02:00
Alan Colon
b00b27ceaf Enable .set with node, or new soul. 2016-10-23 14:33:56 -06:00
Alan Colon
1ab36fa3e1 .off for .on, .map, and .path 2016-10-23 00:24:54 -06:00
Mark Nadal
0aef927eec Update gun.js 2016-10-18 12:11:02 -07:00
Mark Nadal
23f126f219 Update gun.js 2016-10-18 12:05:14 -07:00
BartVDACodeware
fc8aa597a7 check for window.localStorage
Hi, the window.localStorage gives an exception when you use it in Edge on localHost or from a file based html.
I've added a check for the localStorage.
The code is a snipped from here: https://mathiasbynens.be/notes/localstorage-pattern
2016-10-14 22:04:03 +02:00