Repository navigation
fix(storage): include asserted in load_fact duplicate detection key (issue #75) - #80
Merged
Merged
Conversation
Issue: load_fact deduplication key omitted the asserted field, which could lead to silent retraction loss if assertion and retraction share tx_count. Fix: Add asserted to the composite key in load_fact: (entity, attribute, value, valid_from, valid_to, tx_count, asserted) Also adds test_load_fact_duplicate_detection_includes_asserted to verify that facts with same key but different asserted values both survive.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #80 +/- ##
=======================================
Coverage 84.90% 84.90%
=======================================
Files 25 25
Lines 4478 4479 +1
=======================================
+ Hits 3802 3803 +1
Misses 676 676
🚀 New features to boost your workflow:
|
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.
Summary
assertedto the composite duplicate-detection key inload_fact(entity, attribute, value, valid_from, valid_to, tx_count, asserted)test_load_fact_duplicate_detection_includes_assertedto verify facts with same key but different asserted values both surviveThis prevents silent retraction loss if assertion and retraction ever share the same tx_count.