@net-mesh/browser 0.41.0 → 0.41.1

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,36 @@ 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.41.1 — two pages can connect to each other at once
18
+
19
+ - **`connectPeer` from both sides no longer cancels both attempts.** When
20
+ two pages called `connectPeer` on each other at the same moment, each
21
+ answer retired the answerer's own offer, both ran out their ICE
22
+ deadline, and the pair stayed relayed. Every game had to hand-code a
23
+ tie-break. The SDK now does it, on `BrowserNode` and `MeshSession`
24
+ alike:
25
+ - the page with the **lower** node id offers;
26
+ - the higher one answers an offer from that peer that arrived within
27
+ the offerer's ICE deadline instead of offering back, and answers one
28
+ that crosses its own offer while that is under way. Once an answer
29
+ has started, its outcome is the call's;
30
+ - `acceptPeer` while this surface's own `connectPeer` for the peer is
31
+ in flight takes that call's outcome.
32
+
33
+ Offers are learned from the surface's verified signal events. With
34
+ none, or with the peer's node id unknown, `connectPeer` behaves as
35
+ before. One offerer per pair is an attempt at a direct link, not a
36
+ guarantee of one: read `peerAttempt()`.
37
+ - **`joinLobby`'s `close()` resolves only once its withdrawal has
38
+ settled.** An announcement replaces a node's whole tag set, so a
39
+ withdrawal still in flight when the page went on to `createLobby`
40
+ could land after the new listing and erase it. The withdrawal also
41
+ waits for any seeking announcement still in flight.
42
+ - **`counters()` reports each drop reason.** The leaf's nested `drops`
43
+ object came back as the string `"[object Object]"`; nested groups now
44
+ flatten to dotted keys (`drops.<reason>`), each still an exact decimal
45
+ string.
46
+
17
47
  ## 0.41.0 — the whole module surface is exported
18
48
 
19
49
  - **Every module-level export is reachable from an entry point.** Code
package/README.md CHANGED
@@ -576,9 +576,11 @@ For views the rules can't express, write the projection yourself:
576
576
  audience })` (one per player). The declared rules still apply after it, so your
577
577
  code can hide more but never reveal a declared secret.
578
578
 
579
- **One tab per player.** All tabs of the same site in one browser profile share a
580
- single identity, so two tabs are the *same* player — and a player can't join
581
- itself. To test with two players on one machine, use two browser profiles, or
579
+ **One tab per player.** With `rememberedIdentity()`, all tabs of the same site in
580
+ one browser profile share a single identity once it is stored (two tabs that
581
+ call it for the very first time at once can each create their own), so two tabs
582
+ are the *same* player — and a player can't join itself. (Without it, every tab's `connect()` is a new
583
+ player.) To test with two players on one machine, use two browser profiles, or
582
584
  two different browsers.
583
585
 
584
586
  **Announcements expire.** A host that announces once disappears from searches