activegraph 12.0.0.beta.6 → 12.0.0.beta.7

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: 6f10f61337255f2e1e68ba9e4a7d06c5cad602ee9d94fd3258d6c4437f40f64d
4
- data.tar.gz: e7525d5641cb10951fb92e973259a6ec88ca83d529070065b8cd75491791cf02
3
+ metadata.gz: 855f60d7bca8cec018819f65c0765be6002683af5617b3ec2e81b8c0cc5559e0
4
+ data.tar.gz: 06261c803fc0c5ed98d7b32b4bb621f7d2a239b8519c7f23e9c2c84458018271
5
5
  SHA512:
6
- metadata.gz: 7f56d37e271db3e850cf861384afa46e7cf2427656ef9392982bdb6f46834499db15eeb943e3d6f6149af23d902d719bfd7ea07b601dab9032f022768e1f67a2
7
- data.tar.gz: 2c452170b87d7fbe6e83ce87965bd2c30ef671edcd6083b819f1160f2175a9aee0d82d3187eed86e0e6ac8174f5883a5541be4a4d8b72b6154e69ace9714e348
6
+ metadata.gz: d815973f66662ea91c56b12c0bde8cc5ae17ce5df727c19f735397cce96e4b4549dcda7a1c84fd26dfe645b4ac0602a303a1cd4e2e2aecb33801d7d8d462e4fb
7
+ data.tar.gz: 9e3bf57529430fad4cfb4332bc48f497bf19f17ade7dae94f1047e9a26d953a74b04f157223b1a382a0f07b7422b4f018e47a1bdd60d6dc964f607060e2636d3
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
3
3
  This file should follow the standards specified on [http://keepachangelog.com/]
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [12.0.0.beta.7] (2026-03-19)
7
+
8
+ ### Fixed
9
+ - Improved rollback handling in nested transactions to ensure the result of the block is returned even when a rollback is triggered.
10
+
6
11
  ## [12.0.0.beta.6] 2026-03-18
7
12
 
8
13
  ## Added
@@ -1,7 +1,11 @@
1
1
  module ActiveGraph
2
2
  module Transaction
3
3
  def rollback
4
- fail ActiveGraph::Rollback
4
+ @rolled_back = true
5
+ end
6
+
7
+ def check_rollback
8
+ fail ActiveGraph::Rollback if @rolled_back
5
9
  end
6
10
 
7
11
  def after_commit(&block)
@@ -42,24 +42,27 @@ module ActiveGraph
42
42
  end
43
43
  end
44
44
 
45
- def run_transaction_work(session, method, **config, &block)
46
- implicit = config.delete(:implicit)
45
+ def run_transaction_work(session, method, implicit: false, **config, &block)
46
+ result = nil
47
47
  session.send(method, **config) do |tx|
48
48
  self.tx = tx
49
- block.call(tx).tap do |result|
50
- if implicit &&
51
- [Core::Result, ActiveGraph::Node::Query::QueryProxy, ActiveGraph::Core::Query]
52
- .any?(&result.method(:is_a?))
53
- result.store
54
- end
49
+ (result = block.call(tx)).tap do
50
+ store(it) if implicit
51
+ tx.check_rollback
55
52
  end
56
53
  end.tap { tx.apply_callbacks }
57
54
  rescue ActiveGraph::Rollback
58
55
  # rollbacks are silently swallowed
59
- false # to satisfy save and update conventions
56
+ result
60
57
  ensure
61
58
  self.tx = nil
62
59
  end
60
+
61
+ def store(result)
62
+ if [Core::Result, ActiveGraph::Node::Query::QueryProxy, ActiveGraph::Core::Query].any?(&result.method(:is_a?))
63
+ result.store
64
+ end
65
+ end
63
66
  end
64
67
  end
65
68
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveGraph
2
- VERSION = '12.0.0.beta.6'
2
+ VERSION = '12.0.0.beta.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activegraph
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0.beta.6
4
+ version: 12.0.0.beta.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Brian Underwood, Chris Grigg, Heinrich Klobuczek