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

"notify function called synchronously" message appears when it shouldn't #344

Closed
vilterp opened this Issue Aug 11, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@vilterp

vilterp commented Aug 11, 2015

The following message shows up for every event after

  • a Debug.crash (i.e. a bug in the developer's code)
  • an uncaught javascript exception (i.e. a bug in a Native module or a core library such as Array)

When, according to Evan, "That error is only supposed to show up in development if I do something weird (or when someone is doing crazy stuff with Native modules and ports)":

The notify function has been called synchronously!
This can lead to frames being dropped
Definitely report this to <https://github.com/elm-lang/Elm/issues>

Thus, the vast majority of the time this message is inappropriate because it's a bug in your Elm code or a native module, not a bug in the Elm runtime that you should report to core or the compiler.

Perhaps on a Debug.crash or JS exception from a native module, the runtime should print out a message such as "this module has stopped working because of a Debug.crash" or "this module has stopped working because of a native module exception" once, and then go into a crashed state in which it doesn't process any more events or print out any more messages.

@rtfeldman

This comment has been minimized.

Show comment
Hide comment
@rtfeldman

rtfeldman Aug 13, 2015

Member

This can also happens when JS code being invoked via a port crashes, which happens a lot in my line of work. 😉

Unfortunately I've had trouble reproducing it minimally, but one way to reliably reproduce it is:

  1. Check out the repro-notify branch of Dreamwriter (which induces a runtime exception in a port)
  2. Build it.
  3. Click "new chapter" (the big plus sign in the lower left) twice.

The first time you click it, it will error out with "Uncaught Error: kaboom!" but subsequent clicks will result in notify being triggered synchronously.

kamboom

Member

rtfeldman commented Aug 13, 2015

This can also happens when JS code being invoked via a port crashes, which happens a lot in my line of work. 😉

Unfortunately I've had trouble reproducing it minimally, but one way to reliably reproduce it is:

  1. Check out the repro-notify branch of Dreamwriter (which induces a runtime exception in a port)
  2. Build it.
  3. Click "new chapter" (the big plus sign in the lower left) twice.

The first time you click it, it will error out with "Uncaught Error: kaboom!" but subsequent clicks will result in notify being triggered synchronously.

kamboom

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Sep 22, 2016

Member

There is no such thing as a notify function anymore with 0.17, so it's resolved by removing signals.

Member

evancz commented Sep 22, 2016

There is no such thing as a notify function anymore with 0.17, so it's resolved by removing signals.

@evancz evancz closed this Sep 22, 2016

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