Azure / azure-functions-durable-js

JavaScript library for using the Durable Functions bindings
https://www.npmjs.com/package/durable-functions
MIT License
131 stars 48 forks source link

Make entities use async/await only #380

Closed hossam-nasr closed 2 years ago

hossam-nasr commented 2 years ago

Fixes #373. The df.entity() function before was returning an async function that also calls context.done(), causing the error:

Error: Choose either to return a promise or call 'done'. Do not use both in your script. Learn more: https://go.microsoft.com/fwlink/?linkid=2097909

To be thrown, which was hidden from logs before, but was surfaced after a node worker bug was fixed in https://github.com/Azure/azure-functions-nodejs-worker/pull/555.

This PR removes the context.done() call and replaces it with the return value of the function. Potentially could be considred a "breaking" change since it changes the type signature of the customer-facing df.entity() function

hossam-nasr commented 2 years ago

Closing this in favor of #373 and #397