yrby-actioncable 0.2.2 → 0.2.3
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-actioncable.md +12 -0
- data/README.md +23 -2
- data/lib/y/action_cable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71d5dea23772a176b12bbe5cbfe75a2a8cbe3dfff8e8c73f909330ef9844084b
|
|
4
|
+
data.tar.gz: 78f4d54167275c9e6e2fbade09e17e5c6d2cce7e7975e662ffa7e626fb03cdc1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b434c280c1574f2b34f3517c04b653efaf09ce1cdc279795356b6e2d23b6c68e3dcf92c5a7a42e74f59a43745ccacc305f8372fec143d038dbabf22b53a32a5c
|
|
7
|
+
data.tar.gz: 790513cb6941bb5c9e6f6c3aaa1ce5496e1780fa093872ba867771a3bc3a51ed7b610ec0f291d69e102eee4ef5b8da0f5280cfe51e11b4162e6c97fc9a5879a6
|
data/CHANGELOG-actioncable.md
CHANGED
|
@@ -6,6 +6,18 @@ this project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.3] - 2026-07-01
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Raised the `yrby` floor to `>= 0.3.0`. That release makes
|
|
13
|
+
`Doc#handle_sync_message` answer `SyncStep1` with integrated-only (gap-free)
|
|
14
|
+
state — it no longer serves un-integrable pending structs, which previously
|
|
15
|
+
poisoned peers and drove endless resync traffic. The sync channel serves its
|
|
16
|
+
SyncStep2 response through that method, so with an older core a poisoned server
|
|
17
|
+
store would still hand the gap to clients. No code change here — pinning the
|
|
18
|
+
floor makes gap-free serving self-enforcing instead of dependent on the app
|
|
19
|
+
updating the core gem.
|
|
20
|
+
|
|
9
21
|
## [0.2.2] - 2026-07-01
|
|
10
22
|
|
|
11
23
|
### Changed
|
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
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yrby-actioncable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- JP Camara
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
32
|
+
version: 0.3.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.
|
|
39
|
+
version: 0.3.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: actioncable
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|