React Native 0.82 – JS Timers & Fetch Freeze After Launching a Non-React AppCompatActivity (Worked Fine in Earlier RN Versions)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- android, javascript, react-native
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu bằng cách chạy trình tái hiện bắt buộc tại github.com/ShubhGar/RN-Fetch-issue với React Native 0.82.0, sau đó so sánh hành vi với các phiên bản trước đó được liệt kê. Tập trung vào quá trình chuyển tiếp khi một AppCompatActivity non-React chuyển lên foreground và xác minh rằng các callback của fetch, setTimeout và requestAnimationFrame tiếp tục hoặc tiếp tục chạy lại như mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 127k
- Fork
- 25.3k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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.
Issue khác của react/react-native
-
Needs: Author Feedback Needs: Repro
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
react/react-native#58621 · 1 bình luận ·
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
react/react-native#58610 · 1 bình luận ·
-
Needs: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
react/react-native#58565 · 1 bình luận · 2 reaction ·
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
react/react-native#58555 · 5 bình luận · 2 reaction ·
-
Needs: Attention Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
react/react-native#58526 · 2 bình luận ·
Tất cả issue của react/react-native
Issue tương tự
-
AuTest Bug Tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#13714 ·
-
bug build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
facebookincubator/velox#19143 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tenstorrent/tt-metal#57393 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
objectionary/eo-graphs#74 ·