@net-mesh/browser 0.38.2 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/index.bundle.js +2 -2
- package/dist/leader/session.d.ts +10 -0
- package/dist/leader/session.js +22 -14
- package/dist/local.js +6 -1
- package/dist/net_leaf.d.ts +10 -10
- package/dist/net_leaf.js +33 -33
- package/dist/net_leaf_bg.wasm +0 -0
- package/dist/net_leaf_bg.wasm.d.ts +10 -10
- package/dist/node.d.ts +11 -0
- package/dist/node.js +26 -9
- package/dist/peer-driver.d.ts +48 -0
- package/dist/peer-driver.js +104 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,46 @@ missing method at the call site rather than at install time. Unlike
|
|
|
14
14
|
`@net-mesh/sdk`, this package never depends on `@net-mesh/core` — see
|
|
15
15
|
the README on why it is a sibling package rather than a sub-path.
|
|
16
16
|
|
|
17
|
+
## 0.39.0 — connectPeer waits for an attempt under way
|
|
18
|
+
|
|
19
|
+
- **`connectPeer` no longer cancels an attempt that is still under
|
|
20
|
+
way.** Every offer replaces the pair's link, so a second
|
|
21
|
+
`connectPeer` while the first was connecting cancelled it, and both
|
|
22
|
+
callers ended on the relay or in `iceTimeout`. That happened without
|
|
23
|
+
any page doing anything unusual: `joinLobby` reaches the host, then
|
|
24
|
+
the store it joins reaches it again before its first stream, and
|
|
25
|
+
netcode beside a store does the same. Now, per node (`BrowserNode`
|
|
26
|
+
and `MeshSession` alike):
|
|
27
|
+
- a call while another `connectPeer` for the same peer is in flight
|
|
28
|
+
resolves with that attempt's outcome, without offering again;
|
|
29
|
+
- a call while an `acceptPeer` for the peer is in flight waits for it,
|
|
30
|
+
and takes its outcome when that settles the pair: `direct`;
|
|
31
|
+
`iceTimeout` or `udpBlocked` (an offer straight after would almost
|
|
32
|
+
surely end the same way, a whole ICE deadline later, and the routed
|
|
33
|
+
session stays in place); or `superseded` naming a newer attempt
|
|
34
|
+
(an offer would cancel it). Only after an inconclusive answer
|
|
35
|
+
(`handshakeFailed`, `noAnnouncement`, a supersession with no
|
|
36
|
+
successor) does it offer;
|
|
37
|
+
- concurrent `acceptPeer` calls share one answer;
|
|
38
|
+
- the healthy-pair reading is taken inside that gate, just before any
|
|
39
|
+
offer. On a `MeshSession` it is a proxy round trip, and read ahead of
|
|
40
|
+
the gate it could go stale while an answer finished.
|
|
41
|
+
|
|
42
|
+
This completes the healthy-pair rule from 0.37.0 (a pair already
|
|
43
|
+
direct is never re-offered): a page or library may call `connectPeer`
|
|
44
|
+
"to be sure" at any point, without knocking out the link it is asking
|
|
45
|
+
about. Settled attempts are not remembered, so a later call after a
|
|
46
|
+
failure is a fresh attempt. Another tab's node is outside the rule, as
|
|
47
|
+
it is outside the surface.
|
|
48
|
+
|
|
49
|
+
- **`createLocalMesh` reports a frame's peer as exact decimal**, as the
|
|
50
|
+
real node's `stream_data` does; it used to hand out the sender's hex
|
|
51
|
+
id. A hex id with no letters in it (about one random id in 1,800)
|
|
52
|
+
then read as a different node's decimal, and a store hosted on the
|
|
53
|
+
local mesh answered that joiner at an id that was not on the mesh. A
|
|
54
|
+
test that compared `peerNode` with `nodeIdHex()` compares it with the
|
|
55
|
+
decimal now.
|
|
56
|
+
|
|
17
57
|
## 0.38.2 — dual-stack anchors
|
|
18
58
|
|
|
19
59
|
An anchor can now serve IPv4 and IPv6 players at once
|