Skip to content

sendDefaultPii is reported as deprecated on ReactNativeOptions although dataCollection is hidden #6830

Description

@pressogh

What React Native libraries do you use?

Expo (mobile only), Expo Application Services (EAS), React Navigation, Hermes, RN New Architecture

Are you using sentry.io or on-premise?

sentry.io (SaS)

Are you using any other error monitoring solution alongside Sentry?

Yes, Firebase Crashlytics

@sentry/react-native SDK Version

8.29.0 (@sentry/core 10.75.2)

How does your development environment look like?

  • expo ~57.0.26
  • react-native 0.86.3
  • typescript ~6.0.3
  • oxlint 1.86.0 with oxlint-tsgolint 7.0.2003, typescript/no-deprecated enabled

Sentry.init()

Sentry.init({
  dsn: '...',
  enabled: !__DEV__,
  environment: env.isProduction ? 'prod' : 'dev',
  sendDefaultPii: true,
  enableLogs: true,
  replaysOnErrorSampleRate: 1.0,
  tracesSampleRate: 1.0,
  integrations: [Sentry.mobileReplayIntegration(), navigationIntegration],
});

Steps to Reproduce

  1. Use @sentry/react-native 8.29.0.
  2. Pass sendDefaultPii: true to Sentry.init().
  3. Run a type-aware deprecation check, such as typescript/no-deprecated in oxlint.

Expected Result

sendDefaultPii is not reported as deprecated on ReactNativeOptions.
#6345 hid dataCollection from the React Native options and says to keep using sendDefaultPii until full support lands (#5996).
The wizard v8 template also still generates sendDefaultPii: true for React Native.

Actual Result

typescript(no-deprecated): `sendDefaultPii` is deprecated. Use the option instead, which lets you control each category of collected data individually. `sendDefaultPii` will be removed in the next major version (v11). ...

BaseReactNativeOptions redeclares sendDefaultPii without @deprecated, but ReactNativeOptions extends Omit<Options<ReactNativeTransportOptions>, '_experiments' | 'dataCollection'> first.
The resolved sendDefaultPii property therefore has a single declaration, the deprecated one from @sentry/core/build/types/types/options.d.ts.

I checked this with the TypeScript language service.
When 'sendDefaultPii' is added to the Omit list, the property resolves to the BaseReactNativeOptions declaration and the @deprecated tag is gone:

export interface ReactNativeOptions
  extends Omit<Options<ReactNativeTransportOptions>, '_experiments' | 'dataCollection' | 'sendDefaultPii'>,
    BaseReactNativeOptions {}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions