Skip to content

Fixing Issue 50 - #61

Open
tilo wants to merge 6 commits into
mainfrom
issue-50
Open

Fixing Issue 50 #61
tilo wants to merge 6 commits into
mainfrom
issue-50

Conversation

@tilo

@tilo tilo commented Aug 7, 2026

Copy link
Copy Markdown
Owner

#50

tilo and others added 3 commits August 7, 2026 10:53
…ld validation

Rails shares ONE OverlapValidator instance per model class. The scope proc runs in
the middle of building a record's overlap query, so triggering another validation
of the same class from it deterministically reproduces what a concurrent thread
does to the shared instance. Against the current stateful validator this test is
RED: the overlapping record is reported valid because its existence query runs
with the other record's time range.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ShKZCYJFU7bdDSvRT2FgN1
…across validations

The per-class validator instance stored sql_conditions/sql_values/scoped_model as
instance state while building and running each query. Concurrent validations of
the same model class overwrote each other mid-build, surfacing intermittently as
ActiveRecord::PreparedStatementInvalid ("missing value for :user_id_value") or as
silently wrong validation results.

The query is now built entirely in locals and passed through the call chain; the
attr_accessors are gone and the protected query-building methods take and return
their inputs. No behavior change for single-threaded use — all 85 existing
examples pass unchanged.

Thanks to Jorge Santos (@jsantos) for the original 2019 report.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ShKZCYJFU7bdDSvRT2FgN1
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cff4e03) to head (a636be7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #61   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          115       116    +1     
=========================================
+ Hits           115       116    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ShKZCYJFU7bdDSvRT2FgN1
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