serverlessworkflow / sdk-typescript

Typescript SDK for Serverless Workflow
https://serverlessworkflow.io/
Apache License 2.0
64 stars 16 forks source link

workflow.toJson seems to yield control to React before completion, possibly due to internal asynchrony #179

Open dfiai opened 1 year ago

dfiai commented 1 year ago

First guys thank you for the great instrument it helps me a lot!

What happened: I'm utilizing workflow.toJson and workflow.fromSource to duplicate the workflow. The behavior I'm observing is that when I invoke workflow.toJson, it appears to internally employ an asynchronous process. This seems to result in React relinquishing control before the toJson method has completed its execution. Maybe the problem is in validation lib that you are using?

What you expected to happen: toJson method should work sync

How to reproduce it:

Anything else we need to know?:

Environment:

google chrome, windows, ubuntu