This topic was automatically generated from Slack. You can find the original thread here.
Steve Juth : Hi Everyone! I’m brand new to Pipedream. For some reason I keep getting this error:
ACTIVE_HANDLEThis step was still trying to run code when the step ended. Make sure you promisify callback functions and await all Promises. (Reason: TLSSocket, Learn more: https://pipedream.com/docs/workflows/steps/code/async)
Steve Juth : Hey ! For this test they are not, since they already exist (with a unique index constraint). So, for the 9 companies I’m testing with, 9 ‘skipped saving…’ messages get logged.
Dylan Sather (Pipedream) : Thanks. Would you mind trying to insert a new document and see if that works? I believe in this specific case, the message is a false positive. I’ll take a look at the Mongo code but I believe they probably fail to close the connection fully by the time the client.close() Promise is resolved.
Steve Juth : Also… I modified my code to findOne (w/ await), and then insertOne (w/ await) if nothing was found. Everything seems to function correctly except for the fact that I’m still seeing this message:
ACTIVE_HANDLEThis step was still trying to run code when the step ended. Make sure you promisify callback functions and await all Promises. (Reason: TLSSocket, Learn more: https://pipedream.com/docs/workflows/steps/code/async)
Dylan Sather (Pipedream) : That’s right. This is just a warning so you’re good to proceed. Some client libraries that don’t fully close all outstanding handles (sockets, files) can yield false positives. But if you’re awaiting all Promises and everything else works, you should be ok.
Steve Juth : BTW, I’m really glad I found Pipedream! For quite some time I’ve been writing functions and deploying to Heroku, implementing some integrations with Zapier, and wishing Runkit was more private. I found you guys via a requestbin search in Google.
Steve Juth : The only thing I thought of so far (and maybe this already exists but I just don’t know it) is the ability to (unit) test blocks of code - one at a time.
Dylan Sather (Pipedream) : That’s great feedback. Do you want to unit test Node functions, or whole steps of code that might make an API request to an external service?
Steve Juth : For me it would be whole steps of code, including API calls. Of course, a step-through debugger would be awesome, but I know such things aren’t simple to implement.
Dylan Sather (Pipedream) : Makes a lot of sense. We’re tracking the collapse all feature here if you’d like to follow. We’re also working on a new-and-improved version of the workflow builder that will change the way that some of this information is presented, and I believe it will help with that use case.
The new builder allows for the execution of individual steps, as well, which I think will help with the debugging use case. You won’t be able to attach true tests to a step (such that they would run automatically each time you deployed a new version of a workflow, for example), but we’re thinking a lot about what a testing framework might look like. I think proper mocking of destination APIs might be the hardest thing for us to solve.