Unhandled promises result in white screen of death (silent exceptions)
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C++
- Star
- 127k
- Fork
- 25.3k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 4
Mô tả
Description
Exceptions that occur within an unhandled promise do not trigger React exception handling. This makes it impossible to track exceptions or use standard exception handling methods. We call this the white screen of death.
React Native version:
System:
OS: macOS 11.2.2
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 646.73 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.5.0 - ~/.nvm/versions/node/v14.5.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v14.5.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_282 - /usr/bin/javac
Python: 3.8.6+ - /Users/alitamoore/.pyenv/shims/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.13.1
react-native: ^0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- Build out an app with two buttons
- One button has the promised force crash, the other is not
- Press the promised force crash and you'll see a white screen
- Press the not promised force crash and you'll see the RED screen
Expected Results
Both buttons should show a RED screen or white screen should trigger exception handling
Snack, code example, screenshot, or link to a repository:
import { TouchableOpacity } from "react-native-gesture-handler";
import { Text, View } from "react-native-animatable";
export const forceCrash = () => {
console.log("force crash");
crash();
};
const forceCrashPromise = async () => forceCrash();
const forceCrashNotPromise = () => forceCrash();
const Button = () => (
<View>
<TouchableOpacity onPress={forceCrashPromise}>
<Text>Force Crash Promise</Text>
</TouchableOpacity>
<TouchableOpacity onPress={forceCrashNotPromise}>
<Text>Force Crash Not Promise</Text>
</TouchableOpacity>
</View>
);
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với bản tái hiện TypeScript được cung cấp và so sánh các trình xử lý nút có Promise và không có Promise trong ứng dụng React Native. Tái hiện hành vi của màn hình trắng và màn hình đỏ; được xem là hoàn tất khi một ngoại lệ từ Promise chưa được xử lý đi đến cùng cơ chế xử lý ngoại lệ hiển thị như khi bị crash trực tiếp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react-native, typescript
- Lĩnh vực
- mobile
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100