Skip to content

Conversation

@jkebinger
Copy link
Contributor

Description

Fixes a JavaScript precision issue where large config IDs lose accuracy during telemetry reporting. Config ID 17537369033474523 was being reported as 17537369033474524 due to JavaScript's number precision limits.

Root Cause:

The telemetry system serializes evaluation data to JSON for aggregation, then deserializes it before sending to the API. During JSON.parse(), numeric strings in arrays are automatically converted to JavaScript numbers. For integers larger than Number.MAX_SAFE_INTEGER (2^53 - 1), this causes precision loss.

The Fix:

Changed Long.fromNumber(configId) to Long.fromString(configId) in the telemetry counter deserialization logic. This preserves the exact string representation throughout the JSON round-trip, avoiding JavaScript number precision issues.

Testing

  • Added regression test that verifies config ID 17537369033474523 is preserved exactly during telemetry processing
  • All existing telemetry tests continue to pass
  • Full test suite passes (519 tests)
  • Lint and format checks pass

The fix is minimal and targeted, only affecting the specific conversion point where precision was being lost.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jkebinger jkebinger requested a review from a team as a code owner August 25, 2025 21:49
Copy link
Contributor

@jdwyah jdwyah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@jkebinger jkebinger merged commit cec8568 into main Aug 25, 2025
2 checks passed
@jkebinger jkebinger deleted the fix-id-precision-issue branch August 25, 2025 21:59
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.

3 participants