ghcjs / ghcjs-dom

Make Document Object Model (DOM) apps that run in any browser and natively using WebKitGtk
74 stars 41 forks source link

xhr request race condition readyState already 4 when it should be 1,2,3 .. #89

Open eskimor opened 5 years ago

eskimor commented 5 years ago

When registering onreadystatechange for an XHR, the handler will be called three times with xmlHttpRequestGetReadyState retrieving already 4 every time, instead of just the last time.

This PR suggests this might be a regression in either ghcjs-dom or jsaddle (the PR refers to ghcjs-dom but also refers to versions that only exist for jsaddle).

We were able to fix this issue for reflex-dom by means of this, but the issue obviously lies deeper.

ryantrinkle commented 4 years ago

It's because of this: https://github.com/ghcjs/jsaddle-dom/issues/14

I'm not sure why it's marked async or what the correct solution is.