-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HttpLink
/BatchHttpLink
: Abort AbortController signal more granula…
…rly. (#11040) * keep `observer` reference out of `readMultipartBody` * reset controller reference after request * tests * inline simplified version of `createSignalIfSupported` * changeset * use correct type in `handleError`, remove optional chaining * restructure tests as suggested in PR review * suggested wording change * Update .changeset/smooth-goats-cheat.md Co-authored-by: Jerel Miller <jerelmiller@gmail.com> * PR feedback * move `fetch` mock into `mockFetch` function --------- Co-authored-by: Jerel Miller <jerelmiller@gmail.com>
- Loading branch information
1 parent
28f3f92
commit 125ef5b
Showing
7 changed files
with
259 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'@apollo/client': minor | ||
--- | ||
|
||
`HttpLink`/`BatchHttpLink`: Abort the `AbortController` signal more granularly. | ||
Before this change, when `HttpLink`/`BatchHttpLink` created an `AbortController` | ||
internally, the signal would always be `.abort`ed after the request was completed. This could cause issues with Sentry Session Replay and Next.js App Router Cache invalidations, which just replayed the fetch with the same options - including the cancelled `AbortSignal`. | ||
|
||
With this change, the `AbortController` will only be `.abort()`ed by outside events, | ||
not as a consequence of the request completing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.