@net-mesh/browser 0.38.1 → 0.39.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 CHANGED
@@ -14,7 +14,47 @@ 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.38.1 — dual-stack anchors
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
+
57
+ ## 0.38.2 — dual-stack anchors
18
58
 
19
59
  An anchor can now serve IPv4 and IPv6 players at once
20
60
  (`net-mesh anchor serve --rtc-bind 0.0.0.0:7101 --rtc-bind '[::]:7101'`).