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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fdd96efe432c38bca8b5b8eb31c69cea768361f2ddd89d239819820b1a483bd1
4
- data.tar.gz: 8b7b3571f7aa632468f10eb4c53f6399ec107660b66a4bc5e020111bca038f13
3
+ metadata.gz: ce4164de6e9497a1f6236581facfc1ca47bf33951fc32a977078016dd52a42d2
4
+ data.tar.gz: 1353f914370ba5b0142ece86d1ab38960d0a92c07c63b1e5320b8fe155350ce6
5
5
  SHA512:
6
- metadata.gz: 0aba33eed57da270c02632e475792bc8839e6831a26d9b9e48a9a8103ecfc5d88a47c4068a24477df89e98485dce24ef3d51eaa15c1496780ee3a0ac692d1e0a
7
- data.tar.gz: e62c580f3c82b1c7ace0a6e8ecd62b416f1abfecf7f8b9f8f1a43e441f29b5d9efadffdb228575ba4ef7d8999179fbfb3bd5c3879089e9747f472f8750f99084
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
@@ -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 goes through compacted_state_update, which is gap-free by
118
- # construction, so an unhealed gap contributes nothing while a gap
119
- # healed by a newer tail row is served immediately instead of waiting
120
- # for the next compaction.
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.compacted_state_update
129
+ doc.encode_state_as_update
130
130
  end
131
131
 
132
132
  # Compact the tail into state. The row lock serializes racing
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yrby
4
4
  module Rails
5
- VERSION = "0.6.0"
5
+ VERSION = "0.6.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yrby-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Camara