Skip to content

Commit 47966f6

Browse files
jsonbaileyclaude
andcommitted
chore: combine sampled and success guards in trackJudgeResult
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9fc008e commit 47966f6

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
122122
}
123123

124124
trackJudgeResult(result: LDJudgeResult, graphKey?: string) {
125-
if (!result.sampled) {
126-
return;
127-
}
128-
if (!result.success) {
125+
if (!result.sampled || !result.success) {
129126
return;
130127
}
131128
if (result.metricKey !== undefined && result.score !== undefined) {

packages/sdk/server-ai/src/LDGraphTrackerImpl.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ export class LDGraphTrackerImpl implements LDGraphTracker {
7777
}
7878

7979
trackJudgeResult(result: LDJudgeResult): void {
80-
if (!result.sampled) {
81-
return;
82-
}
83-
if (!result.success) {
80+
if (!result.sampled || !result.success) {
8481
return;
8582
}
8683
if (result.metricKey !== undefined && result.score !== undefined) {

0 commit comments

Comments
 (0)