jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
882 stars 116 forks source link

AbortSignal suddenly aborted #172

Closed alexey2baranov closed 3 years ago

alexey2baranov commented 3 years ago

Something wrong with AbortSignal. It is very hard to repeat this error for me because it works well on demo test but brokes on real project.

Investigation

After some investigation I have found that response.signal aborted between line 99 and 100 jest-fetch-mock/src/index.js . As you can see signal aborted===false on line 99. (see picture 1) https://imgur.com/TtgTn8c.png signal.aborted===false

Then callback called and signal aborted === false still (see picture 2). The callback is pretty short. It is just one line as you can see. https://imgur.com/cyP77vs.png

Then code flow returns back to the fetch-mock and something brokes hire. I can't explain what is going exactly but signal aborted === true hure on line 100 (see picture 3) https://imgur.com/8fkjAUt.png true

I know you may sugest that signal is aborted during async frames in other part of my code. But it isn't. I can't say more then this, maybe this can be helpfull.

alexey2baranov commented 3 years ago

i found