@net-mesh/browser 0.41.1 → 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 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