diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd58117b5..55b0eef84f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ## Unreleased + ### Important Changes - **fix(browser): Ensure IP address is only inferred by Relay if `sendDefaultPii` is `true`** ([#5092](https://github.com/getsentry/sentry-react-native/pull/5092)) @@ -24,6 +25,10 @@ user IP addresses, if you set `sendDefaultPii: true` in your `Sentry.init` optio We apologize for any inconvenience caused! +## Fixes + +- Remove the warning that used to indicate that Time To Initial Display and Time To Full Display are not supported ([#5081](https://github.com/getsentry/sentry-react-native/pull/5081)) + ## 6.20.0 ### Features diff --git a/packages/core/src/js/tracing/timetodisplay.tsx b/packages/core/src/js/tracing/timetodisplay.tsx index f33216b875..6f2ee736fe 100644 --- a/packages/core/src/js/tracing/timetodisplay.tsx +++ b/packages/core/src/js/tracing/timetodisplay.tsx @@ -3,13 +3,10 @@ import { fill, getActiveSpan, getSpanDescendants, logger, SEMANTIC_ATTRIBUTE_SEN import * as React from 'react'; import { useState } from 'react'; -import { isTurboModuleEnabled } from '../utils/environment'; import { SPAN_ORIGIN_AUTO_UI_TIME_TO_DISPLAY, SPAN_ORIGIN_MANUAL_UI_TIME_TO_DISPLAY } from './origin'; -import { getRNSentryOnDrawReporter, nativeComponentExists } from './timetodisplaynative'; +import { getRNSentryOnDrawReporter } from './timetodisplaynative'; import { setSpanDurationAsMeasurement, setSpanDurationAsMeasurementOnSpan } from './utils'; -let nativeComponentMissingLogged = false; - /** * Flags of active spans with manual initial display. */ @@ -62,17 +59,6 @@ function TimeToDisplay(props: { parentSpanId?: string; }): React.ReactElement { const RNSentryOnDrawReporter = getRNSentryOnDrawReporter(); - const isNewArchitecture = isTurboModuleEnabled(); - - if (__DEV__ && (isNewArchitecture || (!nativeComponentExists && !nativeComponentMissingLogged))){ - nativeComponentMissingLogged = true; - // Using setTimeout with a delay of 0 milliseconds to defer execution and avoid printing the React stack trace. - setTimeout(() => { - logger.warn( - 'TimeToInitialDisplay and TimeToFullDisplay are not supported on the web, Expo Go and New Architecture. Run native build or report an issue at https://github.com/getsentry/sentry-react-native'); - }, 0); - } - return ( <> mockWrapper); import * as mockedtimetodisplaynative from './mockedtimetodisplaynative'; jest.mock('../../src/js/tracing/timetodisplaynative', () => mockedtimetodisplaynative); -import { isTurboModuleEnabled } from '../../src/js/utils/environment'; jest.mock('../../src/js/utils/environment', () => ({ isWeb: jest.fn().mockReturnValue(false), isTurboModuleEnabled: jest.fn().mockReturnValue(false), @@ -290,24 +289,6 @@ describe('TimeToDisplay', () => { expect(getInitialDisplaySpanJSON(client.event!.spans!)!.timestamp).toEqual(initialDisplayEndTimestampMs / 1_000); expect(getFullDisplaySpanJSON(client.event!.spans!)!.timestamp).toEqual(initialDisplayEndTimestampMs / 1_000); }); - - test('should not log a warning if native component exists and not in new architecture', async () => { - (isTurboModuleEnabled as jest.Mock).mockReturnValue(false); - - TestRenderer.create(); - await jest.runOnlyPendingTimersAsync(); // Flush setTimeout. - - expect(logger.warn).not.toHaveBeenCalled(); - }); - - test('should log a warning if in new architecture', async () => { - (isTurboModuleEnabled as jest.Mock).mockReturnValue(true); - TestRenderer.create(); - await jest.runOnlyPendingTimersAsync(); // Flush setTimeout. - - expect(logger.warn).toHaveBeenCalledWith( - 'TimeToInitialDisplay and TimeToFullDisplay are not supported on the web, Expo Go and New Architecture. Run native build or report an issue at https://github.com/getsentry/sentry-react-native'); - }); }); function getInitialDisplaySpanJSON(spans: SpanJSON[]) {