Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

sendDefaultPii is reported as deprecated on ReactNativeOptions although dataCollection is hidden

未关闭 适合新手
#6,830 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
react-native, typescript
领域
mobile

调研方向

先从 ReactNativeOptions 和 BaseReactNativeOptions 的声明开始,然后检查 @sentry/core/build/types/types/options.d.ts 中继承的 Options 类型。验证 TypeScript 语言服务围绕 Omit 列表的行为,并运行仓库的类型检查或测试。当 sendDefaultPii 仍可用于 React Native 且不会触发 deprecated 诊断时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Bug React-Native
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 {}
主要语言
TypeScript
星标
1.8k
派生
369
平均合并
18 小时 16 分钟
30 天内合并 PR
103

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/sentry-react-native 的其他 Issue

查看 getsentry/sentry-react-native 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。