-
Notifications
You must be signed in to change notification settings - Fork 925
The request coalescer now throws the AbortSignal's
reason
#2174
The request coalescer now throws the AbortSignal's
reason
#2174
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
8b39005
to
ce9d0f3
Compare
a1db3c6
to
148902b
Compare
ce9d0f3
to
87662a3
Compare
148902b
to
b19be46
Compare
b19be46
to
30e573a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I also didn't know this was the recommended way to manually abort.
@@ -8,6 +8,13 @@ type CoalescedRequest = { | |||
|
|||
type GetDeduplicationKeyFn = (payload: unknown) => string | undefined; | |||
|
|||
const EXPLICIT_ABORT_TOKEN = Symbol( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this a SolanaError
instead? I'm a bit scared of global Symbols because of dual package hazards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fully internal to this module. I throw it through the internal AbortController
that's attached to the internal fetch
.
🎉 This PR is included in version 1.90.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
Summary
I learned today that it's wrong to synthesize an
AbortError
DOMException
with anAbortSignal's
reason
. You should throw thereason
directly.See https://fetch.spec.whatwg.org/#deserialize-a-serialized-abort-reason