Fix missing error tracking in resolve() API#3187
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intoFeb 20, 2026
Merged
Conversation
The resolve(flagKey, defaultValue) method that returns ResolutionDetails was not calling trackErrorResolution() for error cases, causing missing/type-mismatched flags to be excluded from evaluation telemetry. This underreported error rates and skewed aggregated evaluation metrics. Added trackErrorResolution() call in the error branch to match the behavior of convenience methods (resolveBooleanValue, etc.) that properly track errors via resolveTracked().
0xnm
reviewed
Feb 18, 2026
| createSuccessResolution(resolution.flag, resolution.value) | ||
| } | ||
| is InternalResolution.Error -> { | ||
| trackErrorResolution(resolution) |
Member
There was a problem hiding this comment.
it is worth to add a test for this
Added two test cases to verify that trackErrorResolution() is called when the resolve() method encounters errors: - FLAG_NOT_FOUND: verifies error is tracked when flag doesn't exist - TYPE_MISMATCH: verifies error is tracked when flag type doesn't match
Contributor
Author
|
added tests. ptal |
0xnm
reviewed
Feb 18, 2026
| } | ||
|
|
||
| @Test | ||
| fun `M track error evaluation W resolve() { type mismatch and trackEvaluations enabled }`(forge: Forge) { |
Member
There was a problem hiding this comment.
It seems we don't need this test, the branch covered for the assertion is the same as above (the only difference is that for ErrorCode.TYPE_MISMATCH we log a warning as well, but it is not checked in this test).
Instead we need to have a test for the evaluation tracking in case of InternalResolution.Success, it seems such test is missing if I'm not wrong.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3187 +/- ##
===========================================
+ Coverage 71.35% 71.46% +0.11%
===========================================
Files 929 929
Lines 34442 34451 +9
Branches 5813 5813
===========================================
+ Hits 24573 24618 +45
+ Misses 8242 8224 -18
+ Partials 1627 1609 -18
🚀 New features to boost your workflow:
|
0xnm
approved these changes
Feb 20, 2026
gh-worker-dd-mergequeue-cf854d
Bot
deleted the
typo/error-eval-trackoing
branch
February 20, 2026 17:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds missing
trackErrorResolution()call in theresolve(flagKey, defaultValue)method's error branch, ensuring error evaluations are properly tracked in telemetry.Motivation
The
resolve()method that returnsResolutionDetails<T>was not callingtrackErrorResolution()for error cases (FLAG_NOT_FOUND, TYPE_MISMATCH, PARSE_ERROR, PROVIDER_NOT_READY). This caused:The convenience methods (
resolveBooleanValue,resolveStringValue, etc.) correctly track errors viaresolveTracked(), but the detailedresolve()API took a different code path that bypassed error tracking.Additional Notes
This is a one-line fix that adds the
trackErrorResolution(resolution)call to match the behavior of the convenience methods. All existing tests pass.Review checklist (to be filled by reviewers)