Feedback form doesn't open on iOS while a native-stack sheet is presented

未关闭
#6,875 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #6882 来自 @antonis —— 已关闭,未合并

评估

这个 Issue 还没有评估数据。

描述

enhancement React-Native Type: Enhancement User Feedbacks
Versions

@sentry/react-native 8.30.0, React Native 0.86.3 (New Architecture), Expo 57, expo-router 57.0.24, react-native-screens 4.26.2, iOS simulator.

What happens

On iOS, the feedback form doesn't appear when the current screen is a native-stack modal (we hit it on presentation: 'formSheet'). Shake-to-report and showFeedbackForm() both do nothing on those screens, and there's no JS error. The same calls work on regular screens.

The native log shows why:

Attempt to present <RCTFabricModalHostViewController> on <UIViewController> (from <UIViewController>) which is already presenting <RNSScreen>.

FeedbackFormProvider renders the form inside a React Native Modal. Because the provider sits at the app root (via Sentry.wrap), the Modal is presented from the root view controller. When a native-stack sheet is open, that controller is already presenting the sheet, so UIKit refuses the second presentation.

This is easy to miss: many apps open settings, payments and similar flows as sheets, and those are the screens where users can't report bugs.

Steps to reproduce
  1. App wrapped with Sentry.wrap, feedbackIntegration enabled, using a native stack (expo-router or @react-navigation/native-stack).
  2. Open any screen with presentation: 'formSheet'.
  3. Call Sentry.showFeedbackForm() or shake the device.
  4. Nothing appears, and the "already presenting" message shows up in the device log.
What we did

On iOS we render the form inside FullWindowOverlay from react-native-screens instead of Modal. That adds the form above everything in the key window, including presented sheets, and typing, submitting and swipe-to-close all keep working. We left Android on Modal. Since the SDK can't assume react-native-screens is installed, an option to supply your own container for the form, or presenting from the topmost view controller, may be a better fit for the SDK.

主要语言
TypeScript
星标
1.8k
派生
371
平均合并
22 小时 3 分钟
30 天内合并 PR
106

环境准备

从这里开始

  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 摘要。