React Native 0.82 – JS Timers & Fetch Freeze After Launching a Non-React AppCompatActivity (Worked Fine in Earlier RN Versions)
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- android, javascript, react-native
- 領域
- mobile-dev
研究方向
先使用 React Native 0.82.0 執行 github.com/ShubhGar/RN-Fetch-issue 中的必要重現程式,接著將行為與列出的較早版本進行比較。聚焦於 non-React AppCompatActivity 進入前景時的轉換,並確認 fetch 回呼、setTimeout 和 requestAnimationFrame 是否如預期恢復執行或持續執行。
由索引模型根據 Issue 內容生成。
描述
Description
Environment
React: 19.1.1
React Native: 0.82.0
Hermes: Enabled
Platform: Android
Architecture: Reproducible on both Old Architecture & New Architecture
🚨 Summary
After upgrading to React Native 0.82.x, the JS Timers Module and Networking Module freeze whenever a non-React AppCompatActivity is launched from the app (e.g., from a 3rd-party native SDK).
This is a regression —
✅ Everything worked perfectly in RN 0.71 – 0.80
❌ The issue appears only after upgrading to RN 0.81 / 0.82
🔍 What Still Works
JS thread is alive
JS Promise microtasks execute
Native → JS events via DeviceEventEmitter work
React UI continues working
Synchronous JS code runs normally
❌ What Stops Working (Regression)
As soon as a non-React AppCompatActivity takes the foreground:
fetch() stops resolving or rejecting
setTimeout() does not execute
requestAnimationFrame() does not execute
NetworkingModule callbacks do not reach JS
TimersModule does not fire
Fetch requests still GO OUT successfully (verified via proxy tools)
Server responds, but JS never receives the response
This only happens after launching the external AppCompatActivity.
✔️ Working Behavior in Older React Native Versions
In React Native 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79 the exact same code and SDK integration works fully.
Fetch resolves normally.
Timers fire normally.
External AppCompatActivity does not impact the JS environment.
Therefore — this is a regression introduced in RN 0.81 or RN 0.82.
Steps to reproduce
Build any React Native app using RN 0.82
Integrate a simple native SDK that launches a plain AppCompatActivity (not ReactActivity)
Emit an event from the SDK → JS
Inside JS event listener:
Promise.resolve().then() → runs
setTimeout(...) → does NOT run
requestAnimationFrame(...) → does NOT run
fetch() → never resolves
Verify using proxy (e.g., Burp Suite):
Fetch does hit the server
Server sends a valid response
JS never receives the response callback
React Native Version
0.82.0
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
npx @react-native-community/cli -v
20.0.1
shubham.garg@GLH0CY1VHGK2 ~ % npx @react-native-community/cli info
error: unknown command 'info'
(Did you mean init?)
Stacktrace or Logs
Actual Behavior (RN 0.82 Regression)
JS thread alive
Events delivered
Timers & fetch stop working
Network request reaches server
Response returns
JS never gets the response
📌 Expected Behavior (Worked in RN ≤ 0.80)
Launching a non-React Android Activity should NOT pause RN’s TimersModule or NetworkingModule
fetch should continue resolving normally
setTimeout, RAF, requestAnimationFrame should continue executing
This is how React Native behaved for many years until RN 0.81+.
🧠 Diagnosis
Evidence indicates:
ReactContext timers + networking modules get suspended when a non-React AppCompatActivity becomes active.
JS microtasks still run → JS engine (Hermes) alive.
NetworkingModule native → JS callback never fires → indicates bridge suspension.
This DID NOT occur in earlier RN versions.
You can check our sample app https://github.com/payu-intrepos/payu-non-seamless-react
MANDATORY Reproducer
https://github.com/ShubhGar/RN-Fetch-issue
Screenshots and Videos
No response
- 主要語言
- C++
- 星號
- 127k
- 分支
- 25.3k
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
react/react-native 的其他 Issue
-
Needs: Author Feedback Needs: Repro
難度 2/5 1-3 小時 新手友好度 75/100
react/react-native#58659 · 2 則留言 ·
維護者通常 1 天內回覆
-
Needs: Author Feedback Needs: Repro
難度 1/5 1 小時以內 新手友好度 92/100
react/react-native#58621 · 1 則留言 ·
維護者通常 1 天內回覆
-
Add TypeScript declaration for the performance global可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉Needs: Attention Needs: Repro
難度 2/5 1-3 小時 新手友好度 85/100
react/react-native#58610 · 4 則留言 ·
維護者通常 1 天內回覆
-
Needs: Triage :mag:
難度 2/5 1-3 小時 新手友好度 82/100
react/react-native#58565 · 2 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
[Android][Fabric] addViewAt hard-crashes on a placeholder ViewState synthesised by updateEventEmitter可能已有人在做 @wneel 於 22 天前認領。 未關閉Needs: Attention Needs: Repro
難度 2/5 1-3 小時 新手友好度 85/100
react/react-native#58526 · 2 則留言 ·
維護者通常 1 天內回覆
查看 react/react-native 的全部 Issue
相似的 Issue
-
Component: Ruby Type: bug
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
bug needs triage tcp
難度 2/5 1-3 小時 新手友好度 78/100
project-chip/connectedhomeip#74644 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
godotengine/godot#124252 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
texstudio-org/texstudio#4685 ·
維護者通常 1 天內回覆