My use case is: I'm testing a method of pre-fetching API data server side.
Inside the component's onEnter() I dispatch an async action (using redux-thunk) to fetch it, subscribe to state so I can wait for it to complete before calling callback().
In doing so, I found duktape predictably segfaulting.
In order to reproduce it, I ported what I'm doing over to your Usage component example, and used setTimeout to fake the async nature of it. So, I modify the onEnter code to be like this:
It seems to be that running the callback() whilst there are still outstanding async actions may be the cause; if you change waitAttempts to 3 it doesn't crash. If you run it as is, you get this:
Apologies if this is not in the right spot as I'm not sure if it's a bug in my usage, go-starter-kit, the go-duktape binding, or maybe even duktape itself.
My use case is: I'm testing a method of pre-fetching API data server side.
Inside the component's
onEnter()
I dispatch an async action (using redux-thunk) to fetch it, subscribe to state so I can wait for it to complete before callingcallback()
.In doing so, I found duktape predictably segfaulting.
In order to reproduce it, I ported what I'm doing over to your
Usage
component example, and usedsetTimeout
to fake the async nature of it. So, I modify the onEnter code to be like this:It seems to be that running the
callback()
whilst there are still outstanding async actions may be the cause; if you changewaitAttempts
to 3 it doesn't crash. If you run it as is, you get this:Apologies if this is not in the right spot as I'm not sure if it's a bug in my usage, go-starter-kit, the go-duktape binding, or maybe even duktape itself.