Skip to content

fix: call onResult callback for failed rows in BatchEvaluator#19

Merged
yltw27 merged 2 commits intomainfrom
fix/on-result-callback-for-failed-rows
Mar 12, 2026
Merged

fix: call onResult callback for failed rows in BatchEvaluator#19
yltw27 merged 2 commits intomainfrom
fix/on-result-callback-for-failed-rows

Conversation

@yltw27
Copy link
Copy Markdown
Collaborator

@yltw27 yltw27 commented Mar 12, 2026

Summary

  • Bug: onResult callback was only called on the success path (executeRowEvaluation), so failed rows were silently dropped — consumers never saw errors via the callback
  • Fix: Extract shared emitResult() helper used by both success and error paths, ensuring onResult fires for all rows
  • Side effect: Reduces handleRowError cyclomatic complexity (code health 9.09 → 10.0)

Test plan

  • Existing batch evaluator telemetry tests pass (6/6)
  • TypeScript type check clean
  • Biome lint clean
  • CodeScene code health: 10.0/10

🤖 Generated with Claude Code

The onResult callback was only invoked on the success path
(executeRowEvaluation), silently skipping failed rows. This meant
consumers relying on onResult for logging/persistence never saw errors.

Extract shared emitResult helper used by both success and error paths,
which also eliminates callback logic duplication and reduces
handleRowError cyclomatic complexity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yltw27 yltw27 marked this pull request as ready for review March 12, 2026 11:17
@yltw27 yltw27 requested a review from a team as a code owner March 12, 2026 11:17
@yltw27 yltw27 requested review from djslimbo, horlaarsco and matt-koevort and removed request for a team March 12, 2026 11:17
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yltw27 yltw27 merged commit 5d6b394 into main Mar 12, 2026
2 checks passed
@yltw27 yltw27 deleted the fix/on-result-callback-for-failed-rows branch March 12, 2026 13:37
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.

2 participants