Skip to content

#502: Fixed IndexedAbsent to preserve identity and transaction state#503

Merged
rultor merged 1 commit intoyegor256:masterfrom
belfil:502
Feb 17, 2026
Merged

#502: Fixed IndexedAbsent to preserve identity and transaction state#503
rultor merged 1 commit intoyegor256:masterfrom
belfil:502

Conversation

@belfil
Copy link
Contributor

@belfil belfil commented Feb 15, 2026

Closes: #502

Summary of Changes

This PR fixes a bug where IndexedAbsent failed to correctly find all facts with duplicate property values, especially when inserted inside a transaction.

Changes

  • Fix: Updated IndexedAbsent to correctly store and retrieve all facts, even if they share identical property values.
  • Integrity: Added uniq(&:object_id) to the result mapping to ensure distinct facts are preserved while avoiding duplicate entries for a single fact with multiple matching values.
  • Lazy Indexing: Refactored _feed to process only new facts since the last indexing cycle.
  • Decorator Support: Ensured consistency for Taped and LazyTaped via the repack method.

@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Feb 16, 2026

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here.

@rultor
Copy link
Collaborator

rultor commented Feb 16, 2026

@rultor merge

@belfil @yegor256 Oops, I failed. You can see the full log here (spent 1min).

+ '[' false = true ']'
+ cat
+ chmod a+x entry.sh
+ cat
+ echo 'export '\''head=git@github.com:yegor256/factbase.git'\''' ';' 'export '\''pull_id=503'\''' ';' 'export '\''fork=git@github.com:belfil/factbase.git'\''' ';' 'export '\''fork_branch=502'\''' ';' 'export '\''head_branch=master'\''' ';' 'export '\''pull_title=#502: Fixed IndexedAbsent to preserve identity and transaction state'\''' ';' 'export '\''author=yegor256'\''' ';' 'pdd -f /dev/null' ';' 'bundle install --no-color' ';' 'bundle exec rake' ';'
+ sensitive=()
+ set -ex -o pipefail
+ cd repo
+ git remote add fork git@github.com:belfil/factbase.git
+ git remote update
Fetching origin
Fetching fork
From github.com:belfil/factbase
 * [new branch]      367                 -> fork/367
 * [new branch]      474                 -> fork/474
 * [new branch]      477                 -> fork/477
 * [new branch]      482                 -> fork/482
 * [new branch]      488                 -> fork/488
 * [new branch]      491                 -> fork/491
 * [new branch]      492                 -> fork/492
 * [new branch]      496                 -> fork/496
 * [new branch]      498                 -> fork/498
 * [new branch]      500                 -> fork/500
 * [new branch]      502                 -> fork/502
 * [new branch]      504                 -> fork/504
 * [new branch]      506                 -> fork/506
 * [new branch]      benchmark-results   -> fork/benchmark-results
 * [new branch]      code-smells         -> fork/code-smells
 * [new branch]      fix-readme-examples -> fork/fix-readme-examples
 * [new branch]      master              -> fork/master
+ args=()
+ '[' default == default ']'
+ args+=(--ff)
+ '[' default == no ']'
+ '[' default == only ']'
+ '[' false == true ']'
+ BRANCH=__rultor
++ wc -l
++ git show-branch __rultor
+ '[' 0 -gt 0 ']'
+ export BRANCH
+ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
+ git checkout -B __rultor fork/502
Switched to a new branch '__rultor'
Branch '__rultor' set up to track remote branch '502' from 'fork'.
+ git checkout -B master origin/master
Switched to and reset branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
Your branch is up to date with 'origin/master'.
+ '[' false == true ']'
+ KEY=3FD3FA7E9AF0FA4C
+ git merge --gpg-sign=3FD3FA7E9AF0FA4C --no-edit -m '#502: Fixed IndexedAbsent to preserve identity and transaction state' --ff __rultor
Auto-merging test/factbase/indexed/test_indexed_factbase.rb
CONFLICT (content): Merge conflict in test/factbase/indexed/test_indexed_factbase.rb
Automatic merge failed; fix conflicts and then commit the result.
'cid' file is absent, most probably the Docker container wasn't started correctly

@belfil
Copy link
Contributor Author

belfil commented Feb 17, 2026

@yegor256 Conflicts resolved.

@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Feb 17, 2026

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here.

@rultor rultor merged commit 29a8719 into yegor256:master Feb 17, 2026
13 checks passed
@rultor
Copy link
Collaborator

rultor commented Feb 17, 2026

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 5min).

@0crat
Copy link

0crat commented Feb 17, 2026

@belfil Thank you for your contribution! You've earned +16 points for this submission: +24 as the base reward, +8.775 for the 117 hits-of-code you wrote (capped at +16), then reduced to the maximum allowed +24 points, which is then capped at +16 to stay within policy limits. Please keep them coming! Your running score is +570; don't forget to check your Zerocracy account too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexedAbsent fails to find duplicates inside a transaction

4 participants