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

Implement fibers? #129

Open
bomberstudios opened this issue Aug 9, 2018 · 0 comments
Open

Implement fibers? #129

bomberstudios opened this issue Aug 9, 2018 · 0 comments

Comments

@bomberstudios
Copy link

I know you're hard at work with Paddy2, which will probably get rid of this issue, but here it goes anyway…

We're seeing a lot of crashes in Sketch, related to the use of coscript.shouldKeepAround, and Paddy 1 is usually involved. We believe the cause of the crash to be something like this:

  • an action is dispatched and start a long running script using coscript.shouldKeepAround = true
  • a second action is dispatched before the first one has finished. Because there is already a cocoascript context created by the first action, we will reuse it since it's the same command.
  • the second action finishes before the first one (perhaps even synchronously), setting coscript.shouldKeepAround = false
  • we clean up the context since it is not supposed to be kept around
  • the first action finishes and crashes because there is no context since it is not leaking anymore

We added fibersa while ago, precisely to fix this type of issue (you can check the docs for the feature on https://developer.sketchapp.com/reference/api/#async)

Thanks in advance!

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