8000 fix(db): treat rule registration as write to prevent race (issue #94) by adityamukho · Pull Request #102 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(db): treat rule registration as write to prevent race (issue #94) - #102

Merged
adityamukho merged 1 commit into
mainfrom
fix/issue-94-rule-registration
Apr 6, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/issue-94-rule-registration

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

Fix for issue #94 - Rule registration was treated as read-only (no write_lock), allowing concurrent rule mutations without serialization. Now rule registration acquires write_lock to serialize rule changes with fact writes.

Changes

  • src/db.rs: Added to the is_write check
  • src/db.rs: Added explicit handling for Rule in the write path (executes while holding lock)

Issue #94

Fixes issue #94 - Rule registration was treated as read-only (no write_lock),
allowing concurrent rule mutations without serialization. Now rule registration
acquires write_lock to serialize rule changes with fact writes.
@codecov
codecov Bot commented Apr 6, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.70%. Comparing base (cd728f7) to head (54b17c1).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   83.72%   83.70%   -0.03%     
==========================================
  Files          26       26              
  Lines        4806     4810       +4     
==========================================
+ Hits         4024     4026       +2     
- Misses        782      784       +2     
Files with missing lines Coverage Δ
src/db.rs 91.85% <100.00%> (+0.10%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adityamukho
adityamukho merged commit 1bc1e28 into main Apr 6, 2026
15 checks passed
@adityamukho
adityamukho deleted the fix/issue-94-rule-registration branch April 6, 2026 16:33
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.

1 participant

0