Closed
Conversation
Successfully reproduces excessive getRandomValues calls (~62-93 per request) when making fetch requests with Sentry tracing enabled. Root Cause Analysis: - Issue confirmed in @sentry/core tracing utilities - Only 1 unique call pattern, executed 62 times (61 duplicates) - generateSentryTraceHeader/generateTraceparentHeader functions called repeatedly without passing traceId/spanId values, causing default parameters to generate new UUIDs each time - All calls originate from getRandomByte during UUID generation via String.replace() callback Expected: ~2-5 getRandomValues calls per request Actual: ~62-93 getRandomValues calls per request Confirmed working on: - React Native 0.81.5 - @sentry/react-native 7.2.0 - iOS Simulator (iPhone 16 Pro) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| try { | ||
| // Make a simple HTTP request | ||
| const response = await fetch('https://httpbin.org/get'); | ||
| const data = await response.json(); |
There was a problem hiding this comment.
Unused variable data from response parsing
Low Severity
The data variable is assigned from response.json() but never used anywhere in the code. This dead store adds unnecessary code and could confuse future maintainers about whether the parsed response data is needed. If the JSON parsing is intentional to simulate a complete request lifecycle, the result can be discarded without assignment, or the parsing can be removed entirely.
antonis
commented
Feb 24, 2026
Contributor
Author
antonis
left a comment
There was a problem hiding this comment.
Closing this repro as it served its purpose
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.
Reproduction for sentry-react-native#5561
Issue: getsentry/sentry-react-native#5561
Summary
This reproduction successfully demonstrates the excessive
getRandomValuescalls issue reported in sentry-react-native#5561. The app shows that a single HTTP request triggers 62-93 calls togetRandomValuesinstead of the expected 2-5 calls.Key Findings
✅ Issue Reproduced: 62-93
getRandomValuescalls per fetch request✅ Root Cause Identified: Only 1 unique call pattern executed 62 times (61 duplicates)
✅ Location:
@sentry/coretracing utilitiesRoot Cause Analysis
The investigation revealed that all 62 calls share the same stack trace, indicating the same code path is being executed repeatedly. The calls originate from:
generateSentryTraceHeader()/generateTraceparentHeader()in@sentry/core/build/esm/utils/tracing.jstraceId = generateTraceId()andspanId = generateSpanId()getRandomByte()viaString.replace()callbackHow to Run
See the README for detailed setup instructions.
The app includes instrumentation that displays:
getRandomValuescallsEnvironment
🤖 Generated with Claude Code