AbortSignal, TypeError: AbortSignal.timeout is not a function
Đang mở
Chưa có ai nhận issue này.
Issue: Author Provided Repro
Needs: Author Feedback
Resolution: PR Submitted
- 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
I want to abort a fetch request after 5 seconds. I am using following code:
const getStatus = () => {
fetch(`${URL}/api/status`, {
signal: AbortSignal.timeout(5000)
}).then(response => {
console.log(response)
})
.catch(err => {
console.error(err.name, err.code, err.message, err.cause);
})
};
Steps to reproduce
- Install React-Native
- Install newest node version
React Native Version
0.73.1
Affected Platforms
Runtime - Android
Output of npx react-native info
System:
OS: Windows 10 10.0.19045
CPU: (6) x64 Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
Memory: 1.03 GB / 15.93 GB
Binaries:
Node: 21.5.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.3.0 - ~\AppData\Roaming\npm\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowAllTrustedApps: Disabled
IDEs:
Android Studio: AI-212.5712.43.2112.8609683
Visual Studio: Not Found
Languages:
Java: 17.0.8
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.73.1 => 0.73.1
react-native-windows: Not Found
npmGlobalPackages:
*react-native*: Not Found
Stacktrace or Logs
TypeError: AbortSignal.timeout is not a function (it is undefined), js engine: hermes
Reproducer
https://github.com/HenrikZabel/abortsignal-bug/
Screenshots and Videos
No response
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 reproducer abortsignal-bug được liên kết và runtime Android React Native 0.73.1 sử dụng Hermes đã được báo cáo. Truy vết phần triển khai hoặc entry point của AbortSignal để lộ timeout, sau đó xác minh rằng reproducer không còn báo AbortSignal.timeout là undefined.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, react-native
- 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
- 38/100