|
1 | 1 | /* eslint-disable max-lines */ |
2 | | -import { _INTERNAL_safeMathRandom } from '.'; |
3 | 2 | import { getEnvelopeEndpointWithUrlEncodedAuth } from './api'; |
4 | 3 | import { DEFAULT_ENVIRONMENT } from './constants'; |
5 | 4 | import { getCurrentScope, getIsolationScope, getTraceContextFromScope } from './currentScopes'; |
@@ -46,6 +45,7 @@ import { checkOrSetAlreadyCaught, uuid4 } from './utils/misc'; |
46 | 45 | import { parseSampleRate } from './utils/parseSampleRate'; |
47 | 46 | import { prepareEvent } from './utils/prepareEvent'; |
48 | 47 | import { makePromiseBuffer, type PromiseBuffer, SENTRY_BUFFER_FULL_ERROR } from './utils/promisebuffer'; |
| 48 | +import { safeMathRandom } from './utils/randomSafeContext'; |
49 | 49 | import { reparentChildSpans, shouldIgnoreSpan } from './utils/should-ignore-span'; |
50 | 50 | import { showSpanDropWarning } from './utils/spanUtils'; |
51 | 51 | import { rejectedSyncPromise } from './utils/syncpromise'; |
@@ -1289,7 +1289,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> { |
1289 | 1289 | // 0.0 === 0% events are sent |
1290 | 1290 | // Sampling for transaction happens somewhere else |
1291 | 1291 | const parsedSampleRate = typeof sampleRate === 'undefined' ? undefined : parseSampleRate(sampleRate); |
1292 | | - if (isError && typeof parsedSampleRate === 'number' && _INTERNAL_safeMathRandom() > parsedSampleRate) { |
| 1292 | + if (isError && typeof parsedSampleRate === 'number' && safeMathRandom() > parsedSampleRate) { |
1293 | 1293 | this.recordDroppedEvent('sample_rate', 'error'); |
1294 | 1294 | return rejectedSyncPromise( |
1295 | 1295 | _makeDoNotSendEventError( |
|
0 commit comments