yrby 0.2.3-x64-mingw-ucrt → 0.3.0-x64-mingw-ucrt
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 +4 -4
- data/CHANGELOG.md +28 -0
- data/README.md +23 -2
- data/lib/y/3.4/yrby.so +0 -0
- data/lib/y/4.0/yrby.so +0 -0
- data/lib/y/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 645cf20b1169684d796375d80d90f55e0dc15a84a7599698a2113729bbcb9464
|
|
4
|
+
data.tar.gz: d86223016069759b614e42affeafb7ecf67e32a5e689c2b823b7d170594b0253
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe570d9333970baa0828cfad9e52aee93f89b978ecdda253aeb5fc6e02439109efa240bceb181c8624dea0ee68921c07453b6cba35e8dbfc8845d2c751f9f803
|
|
7
|
+
data.tar.gz: 5b4ce84ec7f8af057cdf1cc4a0d7a495b60bead40551bf2b39c7924783e6aef015dde22a152f51a6014b9fd84674e753b0c000e16bf2c915b2929a971ba966fa
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,34 @@ to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.0] - 2026-07-01
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Sync no longer serves un-integrable pending structs.** When a doc holds a
|
|
14
|
+
*pending* struct (a gappy update whose causally-prior update is missing — e.g.
|
|
15
|
+
legacy data recorded before the `update_ready?` gate existed), its integrated
|
|
16
|
+
state vector is empty but `encode_state_as_update` merges the pending bytes back
|
|
17
|
+
in. Answering a peer's `SyncStep1` with that state handed the peer content it
|
|
18
|
+
couldn't integrate, so it parked the same pending forever and the empty-SV /
|
|
19
|
+
non-empty-content mismatch drove endless resync traffic (observed as a browser
|
|
20
|
+
re-sending frames several times a second). `handle_sync_message` now answers
|
|
21
|
+
`SyncStep1` with **integrated-only** state, so a server never serves a struct it
|
|
22
|
+
can't integrate itself. Neutralizes existing poisoned server state on deploy —
|
|
23
|
+
no migration needed. The server's own pending is untouched and still heals if
|
|
24
|
+
the missing dependency later arrives (only then does the content become
|
|
25
|
+
visible in sync). Live delta relay (`Update` frames) is unchanged.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- `Doc#pending?` — true if the doc holds un-integrable pending structs or a
|
|
30
|
+
pending delete set (content waiting on a missing causally-prior update).
|
|
31
|
+
- `Doc#compacted_state_update` — like `encode_state_as_update` (full state) but
|
|
32
|
+
**gap-free**: excludes pending structs/delete set. Use it when persisting or
|
|
33
|
+
serving state other peers will apply. Non-destructive — the doc keeps its
|
|
34
|
+
pending (so it can still heal), and `encode_state_as_update` stays lossless for
|
|
35
|
+
raw-update recovery.
|
|
36
|
+
|
|
9
37
|
## [0.2.3] - 2026-07-01
|
|
10
38
|
|
|
11
39
|
### Fixed
|
data/README.md
CHANGED
|
@@ -142,18 +142,39 @@ doc = Y::Doc.new(12345) # specific client ID (used for CRDT identity)
|
|
|
142
142
|
|
|
143
143
|
# Encoding
|
|
144
144
|
doc.encode_state_vector # => current state vector
|
|
145
|
-
doc.encode_state_as_update # => full update
|
|
145
|
+
doc.encode_state_as_update # => full update (lossless: keeps pending)
|
|
146
146
|
doc.encode_state_as_update(sv) # => update diff against state vector
|
|
147
|
+
doc.compacted_state_update # => full update, gap-free (excludes pending)
|
|
147
148
|
|
|
148
149
|
# Applying updates
|
|
149
150
|
doc.apply_update(update_bytes) # apply raw V1 update
|
|
151
|
+
doc.pending? # => true if holding un-integrable pending structs
|
|
150
152
|
|
|
151
153
|
# Sync protocol
|
|
152
154
|
doc.sync_step1 # => SyncStep1 message (this doc's state vector)
|
|
153
155
|
doc.handle_sync_message(data) # => [msg_type, sync_type, response]; answers a
|
|
154
|
-
# peer's SyncStep1 with
|
|
156
|
+
# peer's SyncStep1 with an integrated-only
|
|
157
|
+
# SyncStep2 (never serves pending structs)
|
|
155
158
|
```
|
|
156
159
|
|
|
160
|
+
### Pending structs and gap-free state
|
|
161
|
+
|
|
162
|
+
If a doc applies an update whose causally-prior update is missing (a "gappy"
|
|
163
|
+
update), yrs parks it as a **pending** struct: the integrated state vector stays
|
|
164
|
+
empty, but the pending block is held as a recovery buffer and heals if the
|
|
165
|
+
missing dependency later arrives. `Doc#pending?` reports this.
|
|
166
|
+
|
|
167
|
+
Pending structs are *not* document state, so they must not cross the sync
|
|
168
|
+
boundary — a peer that receives one can't integrate it and gets stuck. Two
|
|
169
|
+
guarantees keep serving safe:
|
|
170
|
+
|
|
171
|
+
- `handle_sync_message` answers `SyncStep1` with **integrated-only** state, so a
|
|
172
|
+
server never serves a struct it can't integrate itself (this is automatic).
|
|
173
|
+
- `Doc#compacted_state_update` gives you the same gap-free full-state update for
|
|
174
|
+
when you persist or hand off state yourself. It's non-destructive (the doc
|
|
175
|
+
keeps its pending), while `encode_state_as_update` stays lossless so you can
|
|
176
|
+
still preserve the raw pending bytes for recovery.
|
|
177
|
+
|
|
157
178
|
### Protocol codec (module functions)
|
|
158
179
|
|
|
159
180
|
Classifying and unwrapping wire frames is stateless, so it's exposed as
|
data/lib/y/3.4/yrby.so
CHANGED
|
Binary file
|
data/lib/y/4.0/yrby.so
CHANGED
|
Binary file
|
data/lib/y/version.rb
CHANGED