Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSException in XHR request #369

Open
alexfmpe opened this issue Apr 11, 2020 · 0 comments
Open

JSException in XHR request #369

alexfmpe opened this issue Apr 11, 2020 · 0 comments

Comments

@alexfmpe
Copy link
Member

Reproducible example

  1. clone https://github.com/obsidiansystems/obelisk/tree/ae%40reproduce-xhr-domexpection
  2. ob run

Issue

Giving xhrRequest a url with a port number >= 2^16 makes newXMLHttpRequestWithError throw a JSException.

  • with port 65535
    newXMLHttpRequestWithError's callback is called...twice?...with different results?...maybe Fix xhr response handlers getting called 3 times. #255 ?
    65535

  • with port 65536
    Total destruction - a JS exception is thrown, the callback isn't called, and the rest of the widget doesn't run. Commenting out the newXMLHttpRequestWithError makes things die later, when getAndDecode is run.
    65536

The terminal console shows:

A JavaScript exception was thrown! (may not reach Haskell code)
SyntaxError: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL
meditans added a commit to obsidiansystems/chainweaver that referenced this issue Feb 7, 2022
This is because that version has been created to explicitly mask the
errors on the js side, making them surface on the haskell side instead,
see:

reflex-frp/reflex-dom#369

While in this case the bug is not related to port numbers, I was
wondering if the core mechanism of not letting exceptions show up is the
same.
meditans added a commit to obsidiansystems/chainweaver that referenced this issue Feb 7, 2022
This is because that version has been created to explicitly mask the
errors on the js side, making them surface on the haskell side instead,
see: reflex-frp/reflex-dom#369

While in this case the bug is not related to port numbers, I was
wondering if the core mechanism of not letting exceptions show up is the
same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant