Repository navigation
AbortSignal/AbortController doesn't work #50015
Description
Activity
Tip
Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.7. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
- addedNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
on Mar 13, 2025 Tip
Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
Warning
Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
- If your bug is UI related: a Snack
- If your bug is build/upgrade related: a project using our Reproducer Template
- Otherwise send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
Hey @lufinkey, Can you add the minimum reproducer using our Reproducer Template?
Hey @lufinkey, I checked with the Reproducer Template mentioned above Thanks to @migueldaipre . Abort controller worked in my case. You can use the same template to create a reproducible so that it would be easier to target the issue first.
Reacted by Miguel Daipré and Luis Finke- Gotcha, I'll try to put together a reproduction later today if I have time…On Mon, Mar 17, 2025, 1:01 AM Sandeep Singh ***@***.***> wrote: Hey @lufinkey <https://github.com/lufinkey>, I checked with the Reproducer Template mentioned above Thanks to @migueldaipre <https://github.com/migueldaipre> . Abort controller worked in my case <https://github.com/sandeepeven/react-native-issue-abort-controller>. You can use the same template to create a reproducible so that it would be easier to target the issue first. — Reply to this email directly, view it on GitHub <#50015 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB3VGUIB22OWEQAO2WMIIAT2UZJKXAVCNFSM6AAAAABY6TQ77KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRYGE2TONBYG4> . You are receiving this because you were mentioned.Message ID: ***@***.***> [image: sandeepeven]*sandeepeven* left a comment (react/react-native#50015) <#50015 (comment)> Hey @lufinkey <https://github.com/lufinkey>, I checked with the Reproducer Template mentioned above Thanks to @migueldaipre <https://github.com/migueldaipre> . Abort controller worked in my case <https://github.com/sandeepeven/react-native-issue-abort-controller>. You can use the same template to create a reproducible so that it would be easier to target the issue first. — Reply to this email directly, view it on GitHub <#50015 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB3VGUIB22OWEQAO2WMIIAT2UZJKXAVCNFSM6AAAAABY6TQ77KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRYGE2TONBYG4> . You are receiving this because you were mentioned.Message ID: ***@***.***>
- addedNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.and removed
on Mar 17, 2025 Having the same issue when trying to cancel long polling requests.
- Sorry I've been lagging on this, I'll set up a replication project soon…On Thu, Apr 3, 2025, 11:41 PM L. Bensaadi ***@***.***> wrote: Having the same issue when trying to cancel long polling requests. — Reply to this email directly, view it on GitHub <#50015 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB3VGUI72CQD6A6NVALO3PT2XX5NPAVCNFSM6AAAAABY6TQ77KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZXGQ4DKMRWHE> . You are receiving this because you were mentioned.Message ID: ***@***.***> [image: bensaadi]*bensaadi* left a comment (react/react-native#50015) <#50015 (comment)> Having the same issue when trying to cancel long polling requests. — Reply to this email directly, view it on GitHub <#50015 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB3VGUI72CQD6A6NVALO3PT2XX5NPAVCNFSM6AAAAABY6TQ77KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZXGQ4DKMRWHE> . You are receiving this because you were mentioned.Message ID: ***@***.***>
Partial temporary solution (for throwIfAborted error) sindresorhus/ky#588 (comment)
Reacted by Samy- Reacted by Luis Finke, 0xRoy, Emil Junker and kesha-antonov
Any updates on this? Would be good to know if there are any plans to implement this.
Reacted by Emil Junker- AbortSignal.any not implemented
not working in rn 0.79.5 with expo
Reacted by enestatli and Rahul Mathur- added a commit that references this issue
on Oct 25, 2025 - added a commit that references this issue
on Feb 23, 2026 This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.
- addedStaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
on Mar 7, 2026 This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
- removedStaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
on Mar 7, 2026 Production impact data for this issue, from a React Native 0.86 app with a realtime sync engine (Rocicorp Zero) whose reconnect loop calls
controller.abort(reason)and then throwssignal.reason:Because the bundled
abort-controller@3.0.0(Libraries/Core/setUpXHR.js) predatessignal.reason, that throw isthrow undefined, which the sync engine classifies as a fatal internal error instead of a retryable one. The result in production: every transient connect failure became a permanent sync outage — plain airplane mode parked sync in ~200ms, our fleet's time-to-connect p90 was 247 seconds with multi-minute permanent stalls, and the engine's entire retry/backoff path was dead code on React Native.We verified the diagnosis by intervention: a local patch adding spec-compliant
abort(reason)/signal.reasonto the bundled polyfill (via pnpm patchedDependencies, covering both dist/.js and dist/.mjs since Metro resolves .mjs first) restored retry end to end on-device with zero permanent stalls across the patched sessions.Minimal repro of the underlying gap, no app required:
// npm i abort-controller@3.0.0 (the exact package RN bundles) const { AbortController } = require("abort-controller"); const controller = new AbortController(); controller.abort(new Error("ConnectTimeout")); // reason silently dropped console.log(controller.signal.aborted); // true console.log(controller.signal.reason); // undefined <- what Zero throws // Node's native AbortController prints `Error: ConnectTimeout` instead.
Proposed fix: replace or vendor a reason-capable AbortController in RN core, or ship it from Hermes. Waiting on the bundled dependency doesn't seem viable —
abort-controller's last release was 2019 and the project appears unmaintained. A compliant implementation in core would fix this class for every library that follows the spec'd abort-reason contract.
Description
fetch, or any other async task that should be cancellable (docs here)fetchrequests.Steps to reproduce
React Native Version
0.76.1
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx @react-native-community/cli infoStacktrace or Logs
Reproducer
N/A
Screenshots and Videos
No response