loro-crdt 1.13.8 → 1.14.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
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bbf21c3: fix: avoid unreadable WASM traps (`RuntimeError: unreachable executed`) on invalid arguments. `getCursor` with an invalid `side`, `getEditorOf` at an out-of-range position, and accessing an unknown container (created by a newer version of loro-crdt) now throw catchable JS errors with readable messages or return `undefined` instead of trapping the WASM instance.
8
+
9
+ feat: on a Rust panic, the full panic info (message, `file:line`, and the complete stack including the Rust call path) is now stored as a JS `Error` on `globalThis.__LORO_WASM_LAST_PANIC__` before the instance traps, so applications can recover readable diagnostics from a caught `RuntimeError`.
10
+
11
+ fix: the WASM start hook was never invoked in the `bundler`/`browser`/`base64` builds (the glue checked the JS namespace instead of the wasm exports for `__wbindgen_start`), so no panic hook was installed there at all. The start hook now runs in every build target.
12
+
13
+ feat: out-of-memory failures are now reported too. Allocation failure in WASM bypasses the panic hook and traps silently; the package now wraps the global allocator so OOM stores `loro-crdt: out of WASM memory: allocation of N bytes failed` on `globalThis.__LORO_WASM_LAST_PANIC__` and prints it to `console.error` before trapping.
14
+
15
+ ### Patch Changes
16
+
17
+ - bbcaef6: Fix a panic on import that could permanently break a document's sync.
18
+
19
+ `import_changes_to_oplog` defers the changes whose deps are not yet in the DAG
20
+ and hands them to `extend_pending_changes_with_unknown_lamport` to be parked.
21
+ `try_apply_pending` runs in between and applies changes parked by earlier
22
+ imports, which advances the oplog version, so a deferred change can become
23
+ applicable — or already applied — by the time it is parked. Both outcomes used
24
+ to hit `unreachable!`, compiling to `RuntimeError: unreachable` in WASM.
25
+
26
+ The re-classification is now handled instead of asserted: a change that became
27
+ applicable is applied and cascaded into whatever it unblocks, an already-applied
28
+ one is skipped, and `ImportStatus` reports only what genuinely stayed pending.
29
+
30
+ This mattered most through `import_batch`, which force-detaches the document for
31
+ the duration of the batch and reattaches after the loop. The panic unwound past
32
+ the reattach and left the document detached, so every later import and export
33
+ failed and the document stopped syncing until the process restarted.
34
+
35
+ ## 1.13.9
36
+
37
+ ### Patch Changes
38
+
39
+ - ddc47ec: Retreat the conservative replay base to the latest single-head critical
40
+ version of the two versions' combined history instead of the beginning of
41
+ history. When an import or checkout involves a genuinely concurrent branch,
42
+ the causal replay now starts at the most recent point that no concurrency
43
+ crosses (in the sense of Eg-walker's critical versions), skipping the
44
+ fully-synced common prefix that the old empty-version fallback replayed.
45
+ - ddc47ec: Fix a convergence bug where a movable tree's incrementally maintained state
46
+ could diverge from a full replay of its own oplog. When newly imported
47
+ operations were concurrent with part of the receiving peer's multi-head
48
+ frontier, the diff mode was misclassified as concurrency-free and the tree
49
+ fast path applied the new moves without adjudicating them against the
50
+ existing concurrent branch. The classifier now verifies that every entry
51
+ point of the imported region causally covers the whole current frontier,
52
+ and otherwise retreats the replay base to the latest critical version so
53
+ the competing branches are replayed together.
54
+ - ddc47ec: Correct LCA unmatched-branch detection when an explicit dependency already
55
+ covers the same peer's implicit predecessor. Keep those causally newer imports
56
+ on the current replay base, and avoid rebuilding unchanged list-like containers
57
+ when a genuinely concurrent update needs a conservative base containing a large
58
+ common history.
59
+
3
60
  ## 1.13.8
4
61
 
5
62
  ### Patch Changes