#551: Keep fact replacement atomic#554
Open
GHX5T-SOL wants to merge 1 commit into
Open
Conversation
bibonix
approved these changes
Jun 11, 2026
bibonix
left a comment
Contributor
There was a problem hiding this comment.
The delete-then-insert sequence in Fbe.delete, Fbe.delete_one, and both branches of Fbe.overwrite now sits inside the fb.txn block, so a raised insert rolls the delete back instead of leaving the factbase with the old fact gone. The three new regression tests inject a raising Factbase::Pre to force the insert to fail and then assert that the original fact and every untouched property survive the call. CI is green on actionlint, copyrights, markdown-lint, pdd, reuse, typos, xcop, yamllint, and the rake jobs on ubuntu-24.04 and macos-15. No inline comments.
Member
|
@GHX5T-SOL merge conflict here |
Member
|
Please fix the merge conflicts so this pull request can be merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/claim #551
Closes #551.
Summary
Fbe.overwrite,Fbe.delete, andFbe.delete_oneinside the samefb.txnblock as the replacement insert.Validation
bundle checkbundle exec ruby -Itest test/fbe/test_overwrite.rb -- --no-covbundle exec ruby -Itest test/fbe/test_delete.rb -- --no-covbundle exec ruby -Itest test/fbe/test_delete_one.rb -- --no-covgit diff --checkbundle exec rubocop lib/fbe/overwrite.rb lib/fbe/delete.rb lib/fbe/delete_one.rb test/fbe/test_overwrite.rb test/fbe/test_delete.rb test/fbe/test_delete_one.rbbundle exec rake testbundle exec rubocopbundle exec rakeNo secrets or live-user data used; validation was local and within the repo scope.