@net-mesh/browser 0.42.0 → 0.43.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 +24 -0
- package/README.md +12 -0
- package/dist/index.bundle.js +2 -2
- package/dist/leader/session.d.ts +4 -2
- package/dist/leader/session.js +30 -6
- package/dist/lobby.js +8 -4
- package/dist/net_leaf.d.ts +10 -10
- package/dist/net_leaf.js +35 -35
- package/dist/net_leaf_bg.wasm +0 -0
- package/dist/net_leaf_bg.wasm.d.ts +10 -10
- package/dist/node.d.ts +15 -0
- package/dist/node.js +75 -1
- package/dist/store/host.js +10 -4
- package/dist/store/join.js +38 -2
- package/dist/store/owner.d.ts +11 -0
- package/dist/store/owner.js +27 -7
- package/dist/store/types.d.ts +6 -0
- package/dist/stream.d.ts +29 -1
- package/dist/stream.js +66 -4
- package/dist/udp-probe.d.ts +21 -3
- package/dist/udp-probe.js +78 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,30 @@ 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.43.0 — one identity per origin, bounded streams
|
|
18
|
+
|
|
19
|
+
- **`connect()` locks its identity.** With a custodial identity it takes
|
|
20
|
+
a per-identity Web Lock, so a second tab running the same identity is
|
|
21
|
+
refused with `IdentityError` until the first closes. `openSession()`
|
|
22
|
+
elects under the same lock. A page that runs several nodes with one
|
|
23
|
+
identity on purpose passes `lockIdentity: false`.
|
|
24
|
+
- **An unread `LeafStream` is bounded.** Before a consumer attaches it
|
|
25
|
+
holds at most 1,024 frames or 1 MiB, dropping the oldest;
|
|
26
|
+
`droppedBeforeConsumer` counts them. It used to buffer every frame,
|
|
27
|
+
and the store, netcode and region links never read theirs.
|
|
28
|
+
- **Store handles are capped at 16 per peer.**
|
|
29
|
+
- **A follower tab's org calls have a deadline,** across the open and
|
|
30
|
+
every stream leg; a proxied call carries the absolute deadline.
|
|
31
|
+
- **A leader change no longer strands a store:** session streams retire
|
|
32
|
+
with the reopenable "stale stream handle" error, and
|
|
33
|
+
`joinStore().reconnect()` closes the stream it replaces.
|
|
34
|
+
- **`lobby.kick` reads node ids in decimal,** and the join key reaches
|
|
35
|
+
`authorize` on every read decision.
|
|
36
|
+
- **The STUN probe's `notRun`** now also covers gathering that completes
|
|
37
|
+
beside a public host candidate with nothing reflexive and no "no
|
|
38
|
+
response" report (an engine may suppress that reflexive candidate).
|
|
39
|
+
Anywhere else it is silence, and blocked UDP is still `udp-blocked`.
|
|
40
|
+
|
|
17
41
|
## 0.41.1 — two pages can connect to each other at once
|
|
18
42
|
|
|
19
43
|
- **`connectPeer` from both sides no longer cancels both attempts.** When
|
package/README.md
CHANGED
|
@@ -583,6 +583,18 @@ are the *same* player — and a player can't join itself. (Without it, every tab
|
|
|
583
583
|
player.) To test with two players on one machine, use two browser profiles, or
|
|
584
584
|
two different browsers.
|
|
585
585
|
|
|
586
|
+
**A second tab with the same identity is refused.** Two live nodes under one
|
|
587
|
+
identity would evict each other at the anchor, so `connect()` holds a Web Lock
|
|
588
|
+
for its identity while the node is open: a second tab's `connect()` rejects
|
|
589
|
+
with an `IdentityError` (kind `identity`) until the first node closes. Catch it
|
|
590
|
+
and tell the player the game is already open, or run the page through
|
|
591
|
+
`openSession()`, which elects one node per origin and shares it across tabs.
|
|
592
|
+
A `connect()` tab and an `openSession()` tab given the same `entitySecretHex`
|
|
593
|
+
contend for the same lock, so they cannot both run the identity either.
|
|
594
|
+
(`lockIdentity: false` opts out. Where Web Locks are unavailable `connect()`
|
|
595
|
+
takes no lock, and `openSession()` is not a fallback there: it needs Web Locks
|
|
596
|
+
to elect a leader, so it rejects with an `IdentityError`.)
|
|
597
|
+
|
|
586
598
|
**Announcements expire.** A host that announces once disappears from searches
|
|
587
599
|
a few seconds later. Keep re-announcing on a timer, as in step 3a.
|
|
588
600
|
|