AbortSignal, TypeError: AbortSignal.timeout is not a function
オープン
まだ誰も着手していません。
Issue: Author Provided Repro
Needs: Author Feedback
Resolution: PR Submitted
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 4
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている abortsignal-bug の再現手順と、報告されている Hermes を使用する React Native 0.73.1 の Android ランタイムから始めます。timeout を公開している AbortSignal の実装またはエントリーポイントを追跡し、その後、再現手順で AbortSignal.timeout が undefined であると報告されなくなったことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react-native
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100