mistri 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.md +12 -1
- data/lib/mistri/stores/active_record.rb +10 -3
- data/lib/mistri/version.rb +1 -1
- data/lib/mistri/workspace/active_record.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1414bffbf49921cf9e575ea1a8998cfc435b77325d80d55ed76e6564d63311c5
|
|
4
|
+
data.tar.gz: b707010a75d56d65a8c42b50a874807e0f529da6b5878246aa9b34239493c808
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7781114db5365b8ce899af9ab50b8eaf2279979d8110a282d54a4fb3187a2576fc94821c3ddb550e9af3da8052ad64b14310c5136d3a064044aee57418c209b
|
|
7
|
+
data.tar.gz: d87fb8db281d3c6cedaea995054723f4f15d62e5268384393e16d655dfd45ba714e4b276c73c378307e8b3314ecec1108b3d320578edd659d77e6d07a8e34e2f
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.6.1] - 2026-07-21
|
|
9
|
+
|
|
10
|
+
- The ActiveRecord store and workspace read past the host's query cache.
|
|
11
|
+
Rails keeps the cache on for a job's whole span and serves repeated
|
|
12
|
+
identical queries from it, so a parent polling for a child's report inside
|
|
13
|
+
a job never saw the report land and every wait ran to its timeout, and a
|
|
14
|
+
workspace read could serve a stale document. Reads bypass only Rails'
|
|
15
|
+
cache: an open REPEATABLE READ transaction still pins its snapshot, so do
|
|
16
|
+
not poll from inside one.
|
|
17
|
+
|
|
8
18
|
## [0.6.0] - 2026-07-12
|
|
9
19
|
|
|
10
20
|
- Synchronous event subscribers now propagate the exact exception object even
|
|
@@ -872,7 +882,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
872
882
|
|
|
873
883
|
- Reserved the gem name.
|
|
874
884
|
|
|
875
|
-
[Unreleased]: https://github.com/mcheemaa/mistri/compare/v0.6.
|
|
885
|
+
[Unreleased]: https://github.com/mcheemaa/mistri/compare/v0.6.1...HEAD
|
|
886
|
+
[0.6.1]: https://github.com/mcheemaa/mistri/compare/v0.6.0...v0.6.1
|
|
876
887
|
[0.6.0]: https://github.com/mcheemaa/mistri/compare/v0.5.0...v0.6.0
|
|
877
888
|
[0.5.0]: https://github.com/mcheemaa/mistri/compare/v0.4.1...v0.5.0
|
|
878
889
|
[0.4.1]: https://github.com/mcheemaa/mistri/compare/v0.4.0...v0.4.1
|
|
@@ -52,10 +52,17 @@ module Mistri
|
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
# Other processes append to a session by design, and hosts poll these
|
|
56
|
+
# reads inside jobs where Rails caches repeated identical queries, so
|
|
57
|
+
# a cached read would never see a child's report land. Read past it.
|
|
58
|
+
# Only past Rails' cache: an open REPEATABLE READ transaction still
|
|
59
|
+
# pins its snapshot, so never poll from inside one.
|
|
55
60
|
def load(id)
|
|
56
|
-
@model.
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
@model.uncached do
|
|
62
|
+
@model.where(session_id: id).pluck(:position, :payload)
|
|
63
|
+
.sort_by(&:first)
|
|
64
|
+
.map { |_position, payload| JSON.parse(payload) }
|
|
65
|
+
end
|
|
59
66
|
end
|
|
60
67
|
end
|
|
61
68
|
end
|
data/lib/mistri/version.rb
CHANGED
|
@@ -20,6 +20,11 @@ module Mistri
|
|
|
20
20
|
# t.timestamps
|
|
21
21
|
# end
|
|
22
22
|
# add_index :mistri_documents, [:session_id, :path], unique: true
|
|
23
|
+
#
|
|
24
|
+
# Reads run uncached: other processes write documents by design, and a
|
|
25
|
+
# cached read inside a job would serve the job's first snapshot forever.
|
|
26
|
+
# Uncached only defeats Rails' cache; an open REPEATABLE READ transaction
|
|
27
|
+
# still pins what reads see, so do not read from inside one.
|
|
23
28
|
class ActiveRecord
|
|
24
29
|
MYSQL_ADAPTERS = %w[Mysql2 Trilogy].freeze
|
|
25
30
|
private_constant :MYSQL_ADAPTERS
|
|
@@ -42,7 +47,7 @@ module Mistri
|
|
|
42
47
|
end
|
|
43
48
|
|
|
44
49
|
def read(path)
|
|
45
|
-
@model.where(**@scope, path: path.to_s).pick(:content)
|
|
50
|
+
@model.uncached { @model.where(**@scope, path: path.to_s).pick(:content) }
|
|
46
51
|
end
|
|
47
52
|
|
|
48
53
|
def write(path, content)
|
|
@@ -60,7 +65,7 @@ module Mistri
|
|
|
60
65
|
|
|
61
66
|
def snapshot(path)
|
|
62
67
|
verify_atomic_context!
|
|
63
|
-
content = relation(path).pick(:content)
|
|
68
|
+
content = @model.uncached { relation(path).pick(:content) }
|
|
64
69
|
content.nil? ? nil : Snapshot.for(content.to_s)
|
|
65
70
|
end
|
|
66
71
|
|
|
@@ -90,7 +95,7 @@ module Mistri
|
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
def list(prefix = nil)
|
|
93
|
-
paths = @model.where(**@scope).pluck(:path).sort
|
|
98
|
+
paths = @model.uncached { @model.where(**@scope).pluck(:path) }.sort
|
|
94
99
|
prefix ? paths.select { |p| p.start_with?(prefix.to_s) } : paths
|
|
95
100
|
end
|
|
96
101
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mistri
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Muhammad Ahmed Cheema
|
|
@@ -134,7 +134,7 @@ metadata:
|
|
|
134
134
|
changelog_uri: https://github.com/mcheemaa/mistri/blob/main/CHANGELOG.md
|
|
135
135
|
allowed_push_host: https://rubygems.org
|
|
136
136
|
rubygems_mfa_required: 'true'
|
|
137
|
-
documentation_uri: https://github.com/mcheemaa/mistri/blob/v0.6.
|
|
137
|
+
documentation_uri: https://github.com/mcheemaa/mistri/blob/v0.6.1/docs/README.md
|
|
138
138
|
bug_tracker_uri: https://github.com/mcheemaa/mistri/issues
|
|
139
139
|
rdoc_options: []
|
|
140
140
|
require_paths:
|