yrby-rails 0.6.0 → 0.6.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 +4 -4
- data/CHANGELOG-rails.md +11 -0
- data/app/models/y/document.rb +6 -6
- data/lib/yrby/rails/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: ce4164de6e9497a1f6236581facfc1ca47bf33951fc32a977078016dd52a42d2
|
|
4
|
+
data.tar.gz: 1353f914370ba5b0142ece86d1ab38960d0a92c07c63b1e5320b8fe155350ce6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5e63dfbc35fd3969cd9effcb26d92f05cfa7f29efb302c7c71ecba11f51bc25b686e99ded9e979cd2c4d382069e4a8c10625a622c389f3e4b0ae3131f959ab7
|
|
7
|
+
data.tar.gz: 120215f5109ec37e77371a59318bb9fded69fbe79338f0a50cf1b6810a784b191bfc8696400369e0ec97e01752f7fc77b0fd74fb85ae220fc2f294d67c26a6c4
|
data/CHANGELOG-rails.md
CHANGED
|
@@ -5,6 +5,17 @@ documented here. The
|
|
|
5
5
|
format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
6
6
|
this project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.6.1] - 2026-08-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `Y::Document.load_state` serves lossless state (`encode_state_as_update`).
|
|
13
|
+
It previously served gap-free state, so a client joining while a gap was
|
|
14
|
+
open never received the parked edit and could not heal it until its next
|
|
15
|
+
handshake. The quarantined row was always preserved; now the pending
|
|
16
|
+
struct rides along in served state and a mid-gap joiner heals the moment
|
|
17
|
+
the missing dependency arrives.
|
|
18
|
+
|
|
8
19
|
## [0.6.0] - 2026-08-11
|
|
9
20
|
|
|
10
21
|
### Changed
|
data/app/models/y/document.rb
CHANGED
|
@@ -113,11 +113,11 @@ class Y::Document < ActiveRecord::Base
|
|
|
113
113
|
# compaction committing between the two reads then hands us rows already
|
|
114
114
|
# folded into the fresh snapshot, an idempotent double-apply, where
|
|
115
115
|
# the reverse order could pair a pre-compaction snapshot with an empty
|
|
116
|
-
# tail and omit committed changes. Quarantined rows are applied too
|
|
117
|
-
# the output
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
116
|
+
# tail and omit committed changes. Quarantined rows are applied too,
|
|
117
|
+
# and the output is lossless (encode_state_as_update): an unhealed gap
|
|
118
|
+
# rides along as a pending struct, so a peer loaded mid-gap holds the
|
|
119
|
+
# parked edit and heals it the moment the missing dependency arrives,
|
|
120
|
+
# while a gap healed by a newer tail row is served merged immediately.
|
|
121
121
|
def load_state
|
|
122
122
|
tail = updates.reset.pluck(:payload) # reset: never a cached tail
|
|
123
123
|
snapshot = self.class.where(id: id).pick(:state)
|
|
@@ -126,7 +126,7 @@ class Y::Document < ActiveRecord::Base
|
|
|
126
126
|
doc = Y::Doc.new
|
|
127
127
|
doc.apply_update(snapshot) if snapshot
|
|
128
128
|
tail.each { |payload| doc.apply_update(payload) }
|
|
129
|
-
doc.
|
|
129
|
+
doc.encode_state_as_update
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
# Compact the tail into state. The row lock serializes racing
|
data/lib/yrby/rails/version.rb
CHANGED