Uh oh!
There was an error while loading. Please reload this page.
fix: Accept any numeric tracking event value - #65
Open
kinyoklion wants to merge 1 commit into
Open
Conversation
Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
@cursor review |
kinyoklion
marked this pull request as ready for review
September 4, 2026 20:32
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 freeto 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.
trackthrew aClassCastExceptionfor a tracking event value which was not aDouble.TrackingEventDetails.getValue()is anOptional<Number>, sonew MutableTrackingEventDetails(99)(anInteger) reached the provider and failed the(Double)cast before any event was sent.Number.doubleValue(), which is what the LaunchDarklytrackMetricAPI takes.Implementation details
The OpenFeature Java SDK does not constrain the numeric type an application passes, and
MutableTrackingEventDetailsstores theNumberas given, so any ofInteger,Long,Float, orBigDecimalreached the cast. OnlyDoubleworked.Testing: the change is covered by
ProviderTest.itCanTrackAnIntegerTrackingEventValue. The test suite could not be run on this machine because Maven Central and the Gradle plugin portal answered dependency resolution with HTTP 429 from this network; CI runs the suite.Link to Devin session: https://app.devin.ai/sessions/fe1eb757fe694ef79f3d09f6307d4b47
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe1eb757fe694ef79f3d09f6307d4b47?variant=devin
Requested by: @kinyoklion
Note
Overview
Fixes
trackfailing with aClassCastExceptionwhenTrackingEventDetailscarries a metric that is not aDouble(for exampleMutableTrackingEventDetails(99)with anInteger).The provider now reads
Optional<Number>viaNumber.doubleValue()before calling LaunchDarklytrackMetric, matching the API’s double metric parameter. A unit test asserts integer metrics are forwarded as99.0.Reviewed by Cursor Bugbot for commit d3177c0. Bugbot is set up for automated code reviews on this repo. Configure here.