AbortController and AbortSignal globals #678
TaylorBeeston
started this conversation in
Ideas
Replies: 1 comment
-
|
Hey @TaylorBeeston, we already had I've added it now in #682, and so the next release of Flask should fix your errors. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there 👋 I'm Taylor from the LEF, working on making a LearnCard snap!
While building out the snap, I managed to work around every issue I came across except one:
AbortControllerandAbortSignalnot being globally available.@learncard/coreinternally depends on Ceramic libraries, which internally have a wrapper function aroundfetchthat automatically times out via the use of anAbortController. In the past I've managed to get around environments that don't have theAbortControllerglobal available by using theabort-controllerpackage to polyfill it, but when doing this inside of the SES runtime, I am running into this error when the fetch call gets made:I dug around a lot to try and find where this error is thrown, and I eventually found myself in the Chromium source code, where it seems like the native
fetchobject will only want to accept nativeAbortSignalobjects (not "fake"AbortSignalobjects created by a polyfill library with JS 😥). I'm not very good at reading C++ code (particularly a codebase as complicated as that!), so I could be wrong in that assumption, but that is where I landed!So, for now, I am using
sedagainst my bundled snap file to actually remove thatAbortSignalobject from being passed in when callingfetch, and everything is happy! This is, however, a pretty bad hack, and I would love it if we could instead just expose the browser's nativeAbortControllerandAbortSignalobjects inside of the snap's SES runtime, as I believe that will fix the problem!AFAIK, there's really no harm that one could cause if they got access to these two globals, though I am also definitely not a security expert, and I am aware of how seemingly innocuous things can become malicious quickly with JS, so I understand that there would probably need to be some research into what possible security risks could be associated with adding these in.
tl;dr My snap is in a hacky, potentially buggy state until
AbortControllerandAbortSignalcan become globally available inside the snap runtime!Beta Was this translation helpful? Give feedback.
All reactions