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

Exception in JS port handler causes Signal to stop updating #541

Closed
robertjlooby opened this Issue Mar 30, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@robertjlooby
Contributor

robertjlooby commented Mar 30, 2016

If a Signal is sent out a port, and the handler errors on the JS side, then the value of the Signal stops updating on the Elm side after the first update.

There is a small example of it here. The displayed time should update once a second to the current time. You'll see it update the display once (which throws the first error) and after that it just errors with the "notify message has been called synchronously" message and the Signal stops updating on the Elm side. There is a related issue here but it seems mostly concerned with providing a more accurate error message.

As a more practical example, the todomvc app will not work on Safari in a private window because any access to localstorage throws an error.


screen shot 2016-03-29 at 10 30 50 pm

robertjlooby referenced this issue in robertjlooby/confsinfo Mar 30, 2016

Add try/catch around localstorage access
so the site still works if this call errors (which it does for example
in a Safari private window)

see: https://github.com/elm-lang/core/issues/541
@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Not sure if this is still true, but there at least are not signals anymore. It may persist in 0.17, but I think that'd need a different SSCCE.

Member

evancz commented May 11, 2016

Not sure if this is still true, but there at least are not signals anymore. It may persist in 0.17, but I think that'd need a different SSCCE.

@evancz evancz closed this May 11, 2016

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Also sorry for the slow response on this stuff! I have been really focused on 0.17 so certain things were getting less attention. Port issues are pretty serious though!

Member

evancz commented May 11, 2016

Also sorry for the slow response on this stuff! I have been really focused on 0.17 so certain things were getting less attention. Port issues are pretty serious though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment