Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbortSignal/AbortController doesn't work #50015

Open
lufinkey opened this issue Mar 13, 2025 · 6 comments
Open

AbortSignal/AbortController doesn't work #50015

lufinkey opened this issue Mar 13, 2025 · 6 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available

Comments

@lufinkey
Copy link

lufinkey commented Mar 13, 2025

Description

  • AbortController / AbortSignal are used in javascript to cancel a request started with fetch, or any other async task that should be cancellable (docs here)
  • In react native, there are several issues with these APIs:
    • DOMException, which is thrown when AbortController is used, doesn't actually exist as a type
    • Calling abortController.abort() doesn't actually have any effect, and abortSignal.reason is undefined.
    • abortSignal.throwIfAborted() doesn't exist as a function
    • I haven't fully verified this, but it looks like AbortController doesn't actually fully abort fetch requests.

Steps to reproduce

  • Use javascript AbortController the way it's documented here

React Native Version

0.76.1

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.3.1
  CPU: (14) arm64 Apple M4 Max
  Memory: 175.34 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: ~/.nvm/versions/node/v22.14.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v22.14.0/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v22.14.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/luisfinke/.rvm/gems/ruby-3.2.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.13103373
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 23.0.1
    path: /usr/bin/javac
  Ruby:
    version: 3.2.0
    path: /Users/luisfinke/.rvm/rubies/ruby-3.2.0/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

N/A

Reproducer

N/A

Screenshots and Videos

No response

@react-native-bot
Copy link
Collaborator

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.

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Mar 13, 2025
@react-native-bot
Copy link
Collaborator

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.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@migueldaipre
Copy link
Collaborator

Hey @lufinkey, Can you add the minimum reproducer using our Reproducer Template?

@sandeepeven
Copy link

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.

@lufinkey
Copy link
Author

lufinkey commented Mar 17, 2025 via email

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available
Projects
None yet
Development

No branches or pull requests

4 participants