Skip to content

httpLink / httpBatchLink don't create their own AbortController, so unsubscribe doesn't cancel the request (same pattern as #7389) #7468

Closed

Description

@MILLERMARRU

#7390 (closing #7389) fixed httpBatchStreamLink: it created its own AbortController and passed it into jsonlStreamConsumer, but the observable's cleanup was a // noop, so abortController.abort() never ran on unsubscribe and the JSONL stream kept consuming from the server after the subscriber disconnected.

I checked the other HTTP links and this same shape exists in two more:

  • httpLink.ts: passes signal: op.signal straight into universalRequester, no internal controller, cleanup is // noop.
  • httpBatchLink.ts: passes allAbortSignals(...batchOps.map(op => op.signal)), still only combining caller-provided per-op signals, no internal controller, cleanup is also // noop.

Compare with the links that already do this correctly: httpSubscriptionLink.ts and localLink.ts both do raceAbortSignals(op.signal, ac.signal) with their own ac = new AbortController(), and call ac.abort() in their cleanup. httpBatchStreamLink.ts now does the same after #7390.

So httpLink and httpBatchLink are the two remaining HTTP links that rely entirely on the caller supplying an op.signal that happens to fire on unsubscribe, instead of owning their own controller tied to the observable's lifecycle the way every other link in the package does. Whenever the caller's op.signal isn't already wired to this specific subscription's teardown, the underlying fetch outlives the subscriber — same wasted-bandwidth/dangling-request consequence as #7389, just without a streamed body to make it as visible in the network tab.

Activity

  1. SnowingFox commented on Aug 13, 2026

    @SnowingFox
    Contributor

    Opened a PR to address this: #7469

  2. added 2 commits that reference this issue on Sep 12, 2026
    13fbc35
    74f9483
  3. added a commit that references this issue on Sep 12, 2026
    d1a9ec6
  4. github-actions commented on Sep 13, 2026

    @github-actions
    Contributor

    This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.

  5. locked as resolved and limited conversation to collaborators on Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions