yrby 0.2.3 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5928987b16a5d3a3933b95875dff276e4e18364b46ed0e33baa8e48b5b2e847
4
- data.tar.gz: 2676689ddee9403765353c4612055fb120ce9e1c6dcdbeb956c482eed313374d
3
+ metadata.gz: addc2f9c08a109299b6c3db7cbf977b9b39194b7d784424b55876e8357897b29
4
+ data.tar.gz: 586d689d080396b5e3c9cf528f49dfbccd5dca831e6e64bbaf6de35216f74143
5
5
  SHA512:
6
- metadata.gz: 7e13256e4881804c3330bf69ce86203bd2aea4bda9313db042f7d368221130f6624285cbddea1a9b61b967c3831635ace45b1291496100872ad8a93c97be2e10
7
- data.tar.gz: fbf1c8c9ec0f0b23190578d562f75fb14a14ec3d562b54b86437c5abda5bd48a97f2da216927f66fde46b5d52fa12d38b4f39b8073b8c6222d656fd09fd2c24f
6
+ metadata.gz: 3412853b540745a3a1db1134104c7cda42330d952b9d6eb08d8c20512069eae93f762aa77204cb6ecc3961da0c117df6bb66ef4b2aad5b0b81b05beedf3253b7
7
+ data.tar.gz: 6d65ed5a61f737cd904800747c40e74d7b57fb0f64f77b12128533a0cfbf4c86058e13d2b2a33d9d005a7bfd015c31683fb25054236dbb3f28639f867d9a3a69
data/CHANGELOG.md CHANGED
@@ -6,6 +6,73 @@ to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.1] - 2026-07-01
10
+
11
+ Fixes from a full source review.
12
+
13
+ ### Fixed
14
+
15
+ - **`Doc#update_ready?` is now exact.** It previously checked only the
16
+ per-client clock lower bound, but yrs's real integration gate also requires
17
+ every block referenced by an item's origin / right-origin / parent — which
18
+ routinely belong to *other* clients — and post-Skip blocks in a merged update
19
+ sit above the lower bound. An update could pass the clock check yet park as
20
+ pending; downstream, `update_advances?` then misread the parked update as an
21
+ already-applied retry (pending doesn't move a state vector) and the sync
22
+ channel **acked and dropped real content**. `update_ready?` now
23
+ trial-integrates on a throwaway probe seeded with the doc's integrated state
24
+ (the clock check remains as a cheap pre-filter), so a cross-client-origin gap
25
+ is correctly rejected for a resync. `update_advances?` also gained defense in
26
+ depth: an update that would park reports as advancing, never as a duplicate.
27
+ - **`Doc#read_text` could deadlock the process.** It opened a second read
28
+ transaction while still holding the first (a chained temporary); yrs's lock is
29
+ write-preferring, so a concurrent writer between the two acquisitions
30
+ deadlocked reader-vs-writer inside the GVL-released (uninterruptible) region.
31
+ Now uses a single transaction.
32
+ - **TOCTOU in gap-free encoding.** The pending check and the encode ran in
33
+ separate transactions, so a concurrent gappy `apply_update` between them could
34
+ make `handle_sync_message`/`compacted_state_update` serve pending structs
35
+ anyway. Both now happen under one transaction.
36
+ - `read_xml`: Lexical soft line breaks and tabs now come through as `\n`/`\t`
37
+ instead of vanishing (`"foo⏎bar"` no longer extracts as `"foobar"`).
38
+
39
+ ### Changed
40
+
41
+ - `update_advances?` skips its full-document probe when the update carries
42
+ blocks beyond the doc's state vector (a novel update trivially advances) —
43
+ the common case no longer pays O(doc) per frame.
44
+ - The gem no longer packages the `yrby-decoder` gem's files (they ship in that
45
+ gem; the duplicate copy could shadow a newer standalone release), and now
46
+ ships `Cargo.lock` so source builds compile the exact crate graph CI tested.
47
+
48
+ ## [0.3.0] - 2026-07-01
49
+
50
+ ### Fixed
51
+
52
+ - **Sync no longer serves un-integrable pending structs.** When a doc holds a
53
+ *pending* struct (a gappy update whose causally-prior update is missing — e.g.
54
+ legacy data recorded before the `update_ready?` gate existed), its integrated
55
+ state vector is empty but `encode_state_as_update` merges the pending bytes back
56
+ in. Answering a peer's `SyncStep1` with that state handed the peer content it
57
+ couldn't integrate, so it parked the same pending forever and the empty-SV /
58
+ non-empty-content mismatch drove endless resync traffic (observed as a browser
59
+ re-sending frames several times a second). `handle_sync_message` now answers
60
+ `SyncStep1` with **integrated-only** state, so a server never serves a struct it
61
+ can't integrate itself. Neutralizes existing poisoned server state on deploy —
62
+ no migration needed. The server's own pending is untouched and still heals if
63
+ the missing dependency later arrives (only then does the content become
64
+ visible in sync). Live delta relay (`Update` frames) is unchanged.
65
+
66
+ ### Added
67
+
68
+ - `Doc#pending?` — true if the doc holds un-integrable pending structs or a
69
+ pending delete set (content waiting on a missing causally-prior update).
70
+ - `Doc#compacted_state_update` — like `encode_state_as_update` (full state) but
71
+ **gap-free**: excludes pending structs/delete set. Use it when persisting or
72
+ serving state other peers will apply. Non-destructive — the doc keeps its
73
+ pending (so it can still heal), and `encode_state_as_update` stays lossless for
74
+ raw-update recovery.
75
+
9
76
  ## [0.2.3] - 2026-07-01
10
77
 
11
78
  ### Fixed